Skip to content

feat: support multi-version reporting in CRP for updateRun#72

Merged
jwtty merged 4 commits intokubefleet-dev:mainfrom
jwtty:crp-status
Jun 2, 2025
Merged

feat: support multi-version reporting in CRP for updateRun#72
jwtty merged 4 commits intokubefleet-dev:mainfrom
jwtty:crp-status

Conversation

@jwtty
Copy link
Collaborator

@jwtty jwtty commented May 21, 2025

Description of your changes

When CRP sets rollout strategy type to External and thus rollout is controlled by an external controller, e.g. an updateRun, the CRP controller cannot make assumption about the real rollout intent and thus should not blindly report progress based on the latest resource snapshot.
This PR fixes by populating the ObservedResourceIndex field in per-cluster ResourcePlacementStatus, showing the whatever exists on the cluster's binding when the rollout type is set to External. And only report CRP availability when all selected clusters observe the same resource index. This essentially supports demonstrating CRP status correctly during rollout and rollback with updateRuns.

Fixes #

I have:

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

How has this code been tested

Special notes for your reviewer

@codecov
Copy link

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/utils/controller/controller.go 68.75% 16 Missing and 4 partials ⚠️
...llers/clusterresourceplacement/placement_status.go 92.64% 4 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@jwtty jwtty force-pushed the crp-status branch 18 times, most recently from f9d1f6a to cdc531d Compare May 26, 2025 07:00
@jwtty jwtty marked this pull request as ready for review May 26, 2025 07:04
}

// TODO (wantjian): we only change the per-cluster status for External rollout strategy for now, so set the ObservedResourceIndex as the latest.
status.ObservedResourceIndex = latestResourceSnapshot.GetLabels()[fleetv1beta1.ResourceIndexLabel]
Copy link
Member

Choose a reason for hiding this comment

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

what does this TODO mean? Are we going to set per-cluster status for rollingUpdate too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, per our original discussion, we show the version existing on the binding for both External and rollingUpdate. This PR does not change the rollingUpdate one as without portal update to display the ObservedResourceIndex, it will look very weird to users: the status is available but it's actually available on a not-shown older version.

@jwtty jwtty force-pushed the crp-status branch 2 times, most recently from 75aa293 to 13ee5b1 Compare May 28, 2025 06:04
jwtty added 4 commits June 2, 2025 00:38
Signed-off-by: Wantong Jiang <wantjian@microsoft.com>
Signed-off-by: Wantong Jiang <wantjian@microsoft.com>
Signed-off-by: Wantong Jiang <wantjian@microsoft.com>
Signed-off-by: Wantong Jiang <wantjian@microsoft.com>
@jwtty jwtty merged commit dc3082d into kubefleet-dev:main Jun 2, 2025
17 checks passed
@jwtty jwtty deleted the crp-status branch June 2, 2025 20:35
audrastump pushed a commit to audrastump/kubefleet that referenced this pull request Aug 20, 2025
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