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

Filter out unrelated subscription resolution failures #214

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

mprahl
Copy link
Member

@mprahl mprahl commented Mar 1, 2024

Since OLM includes a subscription error on all subscriptions in the namespace, even if that subscription itself is unaffected, operator policy needs to know if the error is related to the subscription. This adds some regex filtering to parse the messages since the message format is consistent.

Relates:
https://issues.redhat.com/browse/ACM-10195

@mprahl
Copy link
Member Author

mprahl commented Mar 1, 2024

/hold to make the regex more precise

Copy link
Member

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

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

Seems pretty good! It's just quite a mouthful.

// - no operators found in package %s in the catalog referenced by subscription %s
// - no operators found in channel %s of package %s in the catalog referenced by subscription %s
// - no operators found with name %s in channel %s of package %s in the catalog referenced by subscription %s
func isApplicableConstraintsNotSatisfiable(subscriptionName, packageName, message string) (bool, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This function name is quite a mouthful. I would suggest are instead of is, to match the Constraints since that is plural, but that doesn't really make it feel better. What about something like messageIncludesSubscription?

@mprahl
Copy link
Member Author

mprahl commented Mar 1, 2024

/unhold

JustinKuli
JustinKuli previously approved these changes Mar 1, 2024
Copy link
Member

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

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

/hold

LGTM. Holding in case you want anyone else to look.

Since OLM includes a subscription error on all subscriptions in the
namespace, even if that subscription itself is unaffected, operator
policy needs to know if the error is related to the subscription. This
adds some regex filtering to parse the messages since the message format
is consistent.

Relates:
https://issues.redhat.com/browse/ACM-10195

Signed-off-by: mprahl <mprahl@users.noreply.github.com>
@openshift-ci openshift-ci bot added the lgtm label Mar 1, 2024
Copy link

openshift-ci bot commented Mar 1, 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

@mprahl
Copy link
Member Author

mprahl commented Mar 1, 2024

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit afef83e into open-cluster-management-io:main Mar 1, 2024
4 checks passed
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