Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow two DRPCs with conflicting selectors in the same namespace #1081

Conversation

raghavendra-talur
Copy link
Member

No description provided.

@raghavendra-talur raghavendra-talur force-pushed the rtalur-drpc-conflicting-pvc-labelselector branch from bfc6742 to 30ce48c Compare October 5, 2023 07:21
@raghavendra-talur raghavendra-talur marked this pull request as ready for review October 5, 2023 13:40
@raghavendra-talur raghavendra-talur force-pushed the rtalur-drpc-conflicting-pvc-labelselector branch 3 times, most recently from 07f4b2e to cb4a719 Compare October 6, 2023 06:07
@raghavendra-talur raghavendra-talur changed the title filter drpc pvc labels Don't allow two DRPCs with conflicting selectors in the same namespace Oct 6, 2023
@BenamarMk
Copy link
Member

@raghavendra-talur can you describe the problem you are trying to solve? Is there a bz that this PR is fixing?
I don't see a problem having two DRPCs on the same namespace (openshift-gitops namespace) with the same labelSelector, but different application destination namespace.

rmn "github.com/ramendr/ramen/api/v1alpha1"
plrv1 "github.com/stolostron/multicloud-operators-placementrule/pkg/apis/apps/v1"
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test related to overlapping selector? how?

shouldMatch: false,
},
{
name: "Test with cache and not cache",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using "cache" is confusing, why not "value"?

},
shouldMatch: true,
},
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have obviously matching selector (e.g. key = value, key = value), but we can have some like:

drpc1: key1 = value1
drpc2: key2 = value2

This looks like valid selectors, but the user may add both labels to some PVC and this check cannot detect the issue.

What can work is to add an annotation to the PVC when we protect it with the name of the drpc (like placement). If a PVC is already protected by another drpc the new drpc should fail or report an error that some PVCs could not be handled due to conflict.

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
@raghavendra-talur raghavendra-talur force-pushed the rtalur-drpc-conflicting-pvc-labelselector branch from cb4a719 to 9b6a2fa Compare February 19, 2024 21:55
@raghavendra-talur
Copy link
Member Author

Being addressed by @asn1809 in #1535 in a different way.

@raghavendra-talur raghavendra-talur deleted the rtalur-drpc-conflicting-pvc-labelselector branch September 6, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants