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

fix: allow the rollout controller to sync apply strategy updates #965

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

michaelawyu
Copy link
Contributor

Description of your changes

This PR fixes an issue where apply strategy updates will not be sync'd to binding objects.

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

  • UTs
  • Integration tests

Special notes for your reviewer

pkg/controllers/rollout/controller.go Outdated Show resolved Hide resolved
pkg/controllers/rollout/controller.go Outdated Show resolved Hide resolved
Comment on lines 116 to 126
// Process apply strategy updates (if any).
//
// Apply strategy changes will be immediately applied to all bindings that have not been
// marked for deletion yet. Note that even unscheduled bindings will receive this update;
// as apply strategy changes might have an effect on its Applied and Available status, and
// consequently on the rollout progress.
if err := r.processApplyStrategyUpdates(ctx, &crp, allBindings); err != nil {
klog.ErrorS(err, "Failed to process apply strategy updates", "clusterResourcePlacement", crpName)
return runtime.Result{}, err
}

Copy link
Contributor

Choose a reason for hiding this comment

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

should this be even before the waitForResourcesToCleanUp?

Copy link
Contributor

Choose a reason for hiding this comment

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

a bigger issue is that user have no idea when their change on the applyStrategy is applied as currently we don't reflect that in the CRP status. We need to add another logic in the CRP (which already watch the bindings) to have the appliedStrategy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, the applyStrategy is copied from CRP to the binding during the rolling process which is after this call. What happens if the applyStrategy changes between these two? Should we only change it at one place?

btw, the function is called createUpdateInfo()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Ryan! The call was placed after the waitForResourcesToCleanUp call as the wait method reports a few unexpected errors, which supposedly should trigger alerts and halt the whole system. I am not 100% sure what would be the best way to proceed in these cases so I put the apply strategy refresh after the wait call to be on the safer side.

Though from a correctness perspective it really does not matter I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the two-time update case, at this moment in the reconciliation loop both places read the apply strategy from the same CRP object (retrieved in the very beginning of the loop) so it should be fine (consequent changes will trigger subsequent reconciliations), but we should change it at one place for consistency reasons; I will make the edit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And for the status part, yeah, that's always a concern 😣 At least we need something that can tell the user if the reported info. are based on the current configuration; I could prepare that PR as well. (though it seems that the CRP status is growing bigger and bigger after iterations 😂)

pkg/controllers/rollout/controller_integration_test.go Outdated Show resolved Hide resolved
pkg/controllers/rollout/controller_integration_test.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants