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

rollouts: add ready condition to remote root sync #3737

Conversation

ChristopherFry
Copy link
Contributor

This pull request updates the rollouts proof of concept, adding a ready condition to the remote root sync status. This condition allows us to understand if the remote root sync has connectivity to the target cluster.

Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

Thanks for improving this. I have some minor comments.

rollouts/controllers/remoterootsync_controller.go Outdated Show resolved Hide resolved
generationChanged := rrs.Generation == rrs.Status.ObservedGeneration
readyStatusChanged := len(rrs.Status.Conditions) == 0 || rrs.Status.Conditions[0].Type != "Ready" || rrs.Status.Conditions[0].Status != rssReady

if !generationChanged && !syncStatusChanged && !readyStatusChanged {
Copy link
Contributor

Choose a reason for hiding this comment

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

Another way to do this will be: compute the new status and compare the new status with current using reflect.DeepEqual (that compares the entire struct recursively). That will future proof this code as we evolve the status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking into this. I will need to exclude the Status.Conditions[].LastTransitionTime field from the comparison as this can vary from the existing status and any status I compute from scratch.

rollouts/controllers/remoterootsync_controller.go Outdated Show resolved Hide resolved
@@ -136,42 +141,81 @@ func (r *RemoteRootSyncReconciler) Reconcile(ctx context.Context, req ctrl.Reque

gkeCluster, err := r.store.GetCluster(ctx, cr.Name)
if err != nil {
r.updateStatus(ctx, &remoterootsync, clusterConnectivityFailed, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

I need to double check the underlying code but just getting the cluster shouldn't require reaching out to the target cluster so connectivityFailure may not be applicable.

@droot
Copy link
Contributor

droot commented Feb 13, 2023

@ChristopherFry Do we want to do anything here or close this out ?

@ChristopherFry
Copy link
Contributor Author

Closing this pull request in favor of #3849.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants