fix: only delete conditions of core (#6506)
Signed-off-by: renyunkang <rykren1998@gmail.com>
This commit is contained in:
@@ -871,7 +871,18 @@ func (r *Reconciler) installOrUpgradeKSCoreInMemberCluster(ctx context.Context,
|
||||
}
|
||||
cluster.Annotations[installJobAnnotation] = jobName
|
||||
delete(cluster.Annotations, ksCoreActionAnnotation)
|
||||
cluster.Status.Conditions = []clusterv1alpha1.ClusterCondition{}
|
||||
|
||||
conditions := []clusterv1alpha1.ClusterCondition{}
|
||||
for _, condition := range cluster.Status.Conditions {
|
||||
if condition.Type == clusterv1alpha1.ClusterKSCoreReady ||
|
||||
condition.Type == clusterv1alpha1.ClusterReady ||
|
||||
condition.Type == clusterv1alpha1.ClusterKubeConfigCertExpiresInSevenDays {
|
||||
continue
|
||||
}
|
||||
conditions = append(conditions, condition)
|
||||
}
|
||||
cluster.Status.Conditions = conditions
|
||||
|
||||
if err := r.Update(ctx, cluster); err != nil {
|
||||
return fmt.Errorf("failed to update cluster %s: %v", cluster.Name, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user