Check discovery config azure and access graph resources during integration DeleteAssociatedResources - #69608
Open
charlestp wants to merge 2 commits into
Open
Check discovery config azure and access graph resources during integration DeleteAssociatedResources#69608charlestp wants to merge 2 commits into
charlestp wants to merge 2 commits into
Conversation
alexhemard
reviewed
Aug 12, 2026
| len(a.Spec.Kube) == 0 && | ||
| (a.Spec.AccessGraph == nil || len(a.Spec.AccessGraph.AWS) == 0) | ||
| (a.Spec.AccessGraph == nil || | ||
| (len(a.Spec.AccessGraph.AWS) == 0 && len(a.Spec.AccessGraph.Azure) == 0)) |
Contributor
There was a problem hiding this comment.
since it's only caller is removed should we deprecate IsMatchersEmpty ?
| // HasOtherMatchers returns true if any matcher or Access Graph sync does not use | ||
| // the named integration. GCP and Kubernetes matchers cannot name an integration, | ||
| // so each one counts as another. | ||
| func (a *DiscoveryConfig) HasOtherMatchers(integration string) bool { |
Contributor
There was a problem hiding this comment.
nit: not a blocker, but HasOtherMatchers seems ambiguous as it also checks Access Graph.
ExclusiveToIntegration reads a little clearer, but it's the inverse 🤔
…ation DeleteAssociatedResources
charlestp
force-pushed
the
charles/integration-cascade-delete
branch
from
August 13, 2026 03:49
6561b14 to
b8d2089
Compare
charlestp
force-pushed
the
charles/integration-cascade-delete
branch
from
August 13, 2026 04:05
b8d2089 to
5c3668b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was a fix I came across while implementing the new DiscoveryConfigChangeEvent.
deleteAWSOIDCAssociatedResourceswasn't checking Azure or AccessGraph dependencies, so it could delete discovery configs with other uses, or leave orphaned AccessGraph syncs. The permission check also drifted from how the Github integration check works. Since we're logging the discovery configs that block an integration delete in the error message, this should also require the list permission.Manual Test Plan
Test Environment
Cloud staging tenant running local build
Test Cases