fix-remedy-e2e-errors

Signed-off-by: changzhen <changzhen5@huawei.com>
This commit is contained in:
changzhen 2024-06-11 20:48:52 +08:00
parent 7c13dbb837
commit fcbc92d8cf
2 changed files with 6 additions and 2 deletions

View File

@ -93,7 +93,7 @@ func (c *RemedyController) Reconcile(ctx context.Context, req controllerruntime.
klog.Errorf("Failed to sync cluster(%s) remedy actions: %v", cluster.Name, err)
return controllerruntime.Result{}, err
}
klog.V(4).Infof("Success to sync cluster(%s) remedy actions", cluster.Name)
klog.V(4).Infof("Success to sync cluster(%s) remedy actions: %v", cluster.Name, actions)
return controllerruntime.Result{}, nil
}

View File

@ -277,7 +277,11 @@ func (c *ClusterStatusController) updateStatusIfNeeded(cluster *clusterv1alpha1.
if !equality.Semantic.DeepEqual(cluster.Status, currentClusterStatus) {
klog.V(4).Infof("Start to update cluster status: %s", cluster.Name)
err := retry.RetryOnConflict(retry.DefaultRetry, func() (err error) {
cluster.Status = currentClusterStatus
cluster.Status.KubernetesVersion = currentClusterStatus.KubernetesVersion
cluster.Status.APIEnablements = currentClusterStatus.APIEnablements
cluster.Status.Conditions = currentClusterStatus.Conditions
cluster.Status.NodeSummary = currentClusterStatus.NodeSummary
cluster.Status.ResourceSummary = currentClusterStatus.ResourceSummary
updateErr := c.Status().Update(context.TODO(), cluster)
if updateErr == nil {
return nil