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 a bug that ClusterSet status is no longer updated #5338

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

luolanzone
Copy link
Contributor

@luolanzone luolanzone commented Aug 1, 2023

  1. r.Update() will only update Spec but not status. Revert the change
    back to update status only.
  2. Update the ClusterSet's ClusterID in ClusterSet's reconciler.
  3. Refine test codes for leader ClusterSet controller.

@luolanzone luolanzone added action/backport Indicates a PR that requires backports. area/multi-cluster Issues or PRs related to multi cluster. labels Aug 1, 2023
@luolanzone luolanzone force-pushed the fix-mc-status branch 2 times, most recently from 709adb6 to 46e86d0 Compare August 1, 2023 06:49
@luolanzone
Copy link
Contributor Author

/test-multicluster-e2e

@jianjuns
Copy link
Contributor

jianjuns commented Aug 2, 2023

In commit description:

  1. r.Update() will only update Spec but not status, revise the logic to update the Spec first

Change ", revise" -> ". Revise".

if err != nil {
klog.ErrorS(err, "Failed to update ClusterSet's ClusterID", "name", namespacedName)
}
// Status will be updated in next interval after the ClusterSet spec is updated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is Status updated periodically? Why?

Why we cannot update Status right after the spec update?

Do we have a better place to update the spec with ClusterID, like when the controller first sees the ClusterSet?

1. r.Update() will only update Spec but not status. Revert the change
back to update status only.
2. Update the ClusterSet's ClusterID in ClusterSet's reconciler.
3. Refine test codes for leader ClusterSet controller.

Signed-off-by: Lan Luo <[email protected]>
@@ -199,14 +212,7 @@ func (r *LeaderClusterSetReconciler) updateStatus() {
status.Conditions = []mcv1alpha2.ClusterSetCondition{overallCondition}
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my understanding, could you still answer my question if updateStatus() is called periodically and why?

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 @jianjuns updateStatus() will check the leader's connectivity status in the member cluster's ClusterSet controller, the status update action will be ignored if there is no change. The same function will check the member's connectivity through MemberClusterAnnounce in the leader cluster and the status will also not be updated if there is no change.
I think the main purpose is reflect the connectivity status between leader and member clusters.

@luolanzone
Copy link
Contributor Author

Hi @jianjuns could you help to move forward? I'd like to back port this to v1.13. Thanks.

@jianjuns
Copy link
Contributor

/test-multicluster-e2e
/test-all

@jianjuns
Copy link
Contributor

Hi @jianjuns could you help to move forward? I'd like to back port this to v1.13. Thanks.

Please make sure all required tests are passed.

@luolanzone
Copy link
Contributor Author

@jianjuns sure, thanks for triggering all other tests, I double checked that all required tests are passed now.

@jianjuns jianjuns merged commit 160f25f into antrea-io:main Aug 15, 2023
43 of 44 checks passed
@luolanzone luolanzone deleted the fix-mc-status branch August 15, 2023 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/backport Indicates a PR that requires backports. area/multi-cluster Issues or PRs related to multi cluster.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants