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: update policy snapshot status in cases where only the observed CRP generation changes #569

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

michaelawyu
Copy link
Contributor

Description of your changes

This PR fixes an issue where policy snapshot status will not be updated when the scheduling policy itself does not change, yet the CRP generation is incremented (i.e., resource only change).

It also added a unit test that is not checked in in prev. PRs.

I have:

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

How has this code been tested

  • Unit tests
  • Integration tests
  • E2E tests (upstream)

Special notes for your reviewer

@@ -704,18 +711,16 @@ func (f *framework) updatePolicySnapshotStatusFromBindings(
// Compare the new decisions + condition with the old ones.
currentDecisions := policy.Status.ClusterDecisions
currentCondition := meta.FindStatusCondition(policy.Status.Conditions, string(placementv1beta1.PolicySnapshotScheduled))
if equalDecisions(currentDecisions, newDecisions) && condition.EqualCondition(currentCondition, &newCondition) {
if observedCRPGeneration == policy.Status.ObservedCRPGeneration &&
Copy link
Contributor

Choose a reason for hiding this comment

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

when will we hit the case that the decision/condition doesn't change but the CRP's generation has changed (selector changed)

@ryanzhang-oss ryanzhang-oss merged commit 1c90db0 into Azure:main Oct 19, 2023
zhiying-lin pushed a commit to zhiying-lin/fleet that referenced this pull request Oct 20, 2023
This reverts commit 1c90db0.
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