-
Notifications
You must be signed in to change notification settings - Fork 551
feat(sub): Indicate resolution conflicts on Subscription statuses #2269
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
feat(sub): Indicate resolution conflicts on Subscription statuses #2269
Conversation
8ed8f6a
to
66c9499
Compare
/hold Made changes to the subscription api inside the vendor folder for reviews. PR for api change is here: operator-framework/api#138 will unhold once this and the api repo PR is lgtmed and changes from api is vendored in here. |
return err | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: This is under the assumption that if there is a terminal resolution error, user intervention can resolve the error and get the subscriptions in the objects back to a good state. Is that a correct assumption?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cluster admins can always nuke everything and recreate after the fact. there are also (rather gnarly) workarounds to pop an InstallPlan back into a non-terminal state for a retry (e.g. manually patch InstallPlan status).
66c9499
to
bc1d243
Compare
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great so far.
04ceee0
to
ef12368
Compare
Signed-off-by: Anik Bhattacharjee <[email protected]>
ef12368
to
7447829
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
My only real concern is in the lack of unit tests.
@njhale there are tests here that tests that the method returns the correct value/error when resolver error occurs. |
hmm, I was thinking of the class of test that uses a mock client and tests a wider range of I/O (i.e. not just checking the error) -- but since the e2e test is so similar, I don't think it's worth holding so close to freeze. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anik120, njhale 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 |
@@ -909,9 +909,22 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error { | |||
// not-satisfiable error | |||
if _, ok := err.(solver.NotSatisfiable); ok { | |||
logger.WithError(err).Debug("resolution failed") | |||
updateErr := o.setSubsCond(subs, v1alpha1.SubscriptionResolutionFailed, "Constraint not satisfyable", err.Error(), true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spelling error. this should say Constraint not satisfiable
minus that one nit, this looks good to me |
7447829
to
01054fd
Compare
/lgtm |
@@ -909,9 +909,22 @@ func (o *Operator) syncResolvingNamespace(obj interface{}) error { | |||
// not-satisfiable error | |||
if _, ok := err.(solver.NotSatisfiable); ok { | |||
logger.WithError(err).Debug("resolution failed") | |||
updateErr := o.setSubsCond(subs, v1alpha1.SubscriptionResolutionFailed, "Constraint not satisfiable", err.Error(), true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't Reason usually intended to be machine-readable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch
/hold |
Resolution considers everything in a given namespace as a unit, so conflicts aren't generated on a per-Subscription basis. However, as the main entry point to resolution, users first look at the Subscription to understand resolution failures. The set of conflicts today is written to Events with type ResolutionFailed. This PR projects resolution errors onto all subscriptions on the namespace for any resolution failure. Signed-off-by: Anik Bhattacharjee <[email protected]>
01054fd
to
4a2c5c0
Compare
/hold cancel |
/lgtm |
In operator-framework#2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off.
In operator-framework#2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off.
In operator-framework#2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off. Signed-off-by: Anik Bhattacharjee <[email protected]>
In operator-framework#2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off. Signed-off-by: Anik Bhattacharjee <[email protected]>
In operator-framework#2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off. Signed-off-by: Anik Bhattacharjee <[email protected]>
In operator-framework#2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off. Signed-off-by: Anik Bhattacharjee <[email protected]>
In operator-framework#2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off. Signed-off-by: Anik Bhattacharjee <[email protected]>
* fix(sub): Reset ResolutionFailed cond when error is resolved In #2269, a new condition was introduced for Subscription to indicate any dependency resolution error in it's message. However, when the case of the error was resolved, the condition status (true) and the message was sticking around. This PR fixes the issue, and makes sure that the condition status is set to false, and the message and reason of the condition are cleared off. Signed-off-by: Anik Bhattacharjee <[email protected]> * refractor updateStatusConditions to split calls to api server into it's own task Signed-off-by: Anik Bhattacharjee <[email protected]> * Reduce number of times subscription statues are updated. The statuses of the subscriptions are updated multiple number of times while syncing the resolving namespace. This commit switches to preserving the state of the subscription statues instead, and only updating the statuses on cluster only when it's neccessary. Signed-off-by: Anik Bhattacharjee <[email protected]> * remove unnecessary continue from loop Signed-off-by: Anik Bhattacharjee <[email protected]> * pass reference of sub to goroutine Signed-off-by: Anik Bhattacharjee <[email protected]>
Description of the change:
Resolution considers everything in a given namespace as a unit, so conflicts aren't
generated on a per-Subscription basis. However, as the main entry point to resolution,
users first look at the Subscription to understand resolution failures. The set of conflicts
today is written to Events with type ResolutionFailed. This PR projects resolution errors onto
all subscriptions on the namespace for any resolution failure.
Motivation for the change:
Reviewer Checklist
/doc