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

Check and report on overlapping subs #247

Conversation

JustinKuli
Copy link
Member

This adds two new status fields to OperatorPolicy, which are used to detect when two OperatorPolicies manage the same subscription. Overlapping OperatorPolicies will go into a non-compliant state, report the overlap, and will not compete with each other.

Refs:


var result []reconcile.Request

for _, overlap := range pol.Status.OverlappingPolicies {
Copy link
Member

Choose a reason for hiding this comment

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

Would it be cleaner to have OverlappingPolicies be a struct with the name and namespace field separated?

Copy link
Member Author

Choose a reason for hiding this comment

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

Being able to use slices.Sort, slices.Equal and strings.Join on them as they are right now is kind of nice. It wouldn't be too difficult to get those same kinds of things on a new struct, but I don't think we would gain much overall.

Copy link
Member

@mprahl mprahl left a comment

Choose a reason for hiding this comment

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

A few minor comments but this looks great. Nice solution!

This adds two new status fields to OperatorPolicy, which are used to
detect when two OperatorPolicies manage the same subscription.
Overlapping OperatorPolicies will go into a non-compliant state, report
the overlap, and will not compete with each other.

Refs:
 - https://issues.redhat.com/browse/ACM-11616

Signed-off-by: Justin Kulikauskas <[email protected]>
Copy link

openshift-ci bot commented May 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JustinKuli, mprahl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants