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

Bug 2070887: pkg/cvo/sync_worker.go: set implicitly enabled caps earlier #761

Merged
merged 1 commit into from Apr 7, 2022

Conversation

jottofar
Copy link
Contributor

@jottofar jottofar commented Apr 4, 2022

since implicitly enabled capability changes do not trigger !capabilitiesEqual so we return before setting the status.

@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 4, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 4, 2022

@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
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @shellyyang1989

In response to this:

Bug 2070887: pkg/cvo/sync_worker.go: set implicitly enabled caps earlier

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 4, 2022

@jottofar: This pull request references Bugzilla bug 2070887, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.11.0) matches configured target release for branch (4.11.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @shellyyang1989

In response to this:

Bug 2070887: pkg/cvo/sync_worker.go: set implicitly enabled caps earlier

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.

@openshift-ci openshift-ci bot requested review from vrutkovs and wking April 4, 2022 19:16
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 4, 2022
@jottofar
Copy link
Contributor Author

jottofar commented Apr 4, 2022

/retest

@@ -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"
Copy link
Member

Choose a reason for hiding this comment

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

But:

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

@wking wking left a comment

Choose a reason for hiding this comment

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

:lgtm:

@wking
Copy link
Member

wking commented Apr 6, 2022

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 6, 2022

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 6, 2022
@jottofar
Copy link
Contributor Author

jottofar commented Apr 6, 2022

/retest

1 similar comment
@jottofar
Copy link
Contributor Author

jottofar commented Apr 6, 2022

/retest

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 7, 2022

@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.

@openshift-merge-robot openshift-merge-robot merged commit 3097dfe into openshift:master Apr 7, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 7, 2022

@jottofar: All pull requests linked via external trackers have merged:

Bugzilla bug 2070887 has been moved to the MODIFIED state.

In response to this:

Bug 2070887: pkg/cvo/sync_worker.go: set implicitly enabled caps earlier

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants