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
Bug 2070887: pkg/cvo/sync_worker.go: set implicitly enabled caps earlier #761
Conversation
@jottofar: This pull request references Bugzilla bug 2070887, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jottofar: This pull request references Bugzilla bug 2070887, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
pkg/cvo/sync_worker.go
Outdated
@@ -401,14 +401,16 @@ func (w *SyncWorker) Update(ctx context.Context, generation int64, desired confi | |||
|
|||
work.Capabilities = capability.SetCapabilities(config, priorCaps) | |||
|
|||
// needs to be set here since changes in implicitly enabled capabilities are not considered a "capabilities change" |
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.
But:
equalSyncWork
usesClusterCapabilities.Equal
, andClusterCapabilities.Equal
only looks atEnabledCapabilities
.
I think we may want to change this line to:
capabilitiesError := a.Capabilities.Equal(&b.Capabilities)
...
if capabilitiesError != nil {
msgs = append(msgs, fmt.Sprintf("capabilities changed (%v)", capabilitiesChanged))
}
So we don't have to make local guesses about how the caps changed, but I don't understand where ImplicitlyEnabledCaps
/ ImplicitlyEnabledCapabilities
is coming into this.
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.
I think we may want to change this line to...
I've floated #762 with this tweak.
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.
oh, I think I understand now. This isn't about adjusting what equalSyncWork
does, it's about ensuring the new ImplicitlyEnabledCapabilities
make it through to w.status.CapabilitiesStatus.ImplicitlyEnabledCaps
, regardless of where this function later returns. Can we make that distinction a bit more obvious with something like:
versionEqual, overridesEqual, capabilitiesEqual :=
equalSyncWork(w.work, work, fmt.Sprintf("considering cluster version generation %d", generation))
// Changes to implicitly enabled capabilities are not considered a "capabilities change",
// but still need to be propagated through and reported in status.
w.status.CapabilitiesStatus.ImplicitlyEnabledCaps = work.Capabilities.ImplicitlyEnabledCapabilities
if versionEqual && overridesEqual && capabilitiesEqual {
...
If the positioning you have today makes more sense than what I'm suggesting here, that's fine with me too.
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.
Hmm, maybe I'm misunderstanding your comment and suggestion but let me try and explain my change and reasoning again. The capability.Equal
works fine as is and there's no "guessing" about how caps have changed.
- The only caps change we care about for the purposes of an update are changes to
EnabledCapabilities
.Equal
works correctly in this regard. - We only care about
ImplicitlyEnabledCapabilities
for purposes of capturing them in status.
So for example, post-install C1 and C2 are enabled. Admin then changes C2 to disabled. On next Update
SetCapabilities
will set C2 back to enabled and save C2 into ImplicitlyEnabledCapabilities
. equalSyncWork
properly returns no change since EnabledCapabilities
haven't changed. Before my change Update
would return here before w.status.CapabilitiesStatus.ImplicitlyEnabledCaps
was updated.
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.
:lgtm:
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jottofar, wking 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 |
/retest |
1 similar comment
/retest |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@jottofar: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@jottofar: All pull requests linked via external trackers have merged: Bugzilla bug 2070887 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
since implicitly enabled capability changes do not trigger !capabilitiesEqual so we return before setting the status.