fix: only delete conditions of core (#6506)

Signed-off-by: renyunkang <rykren1998@gmail.com>
This commit is contained in:
Yunkang Ren
2025-05-12 17:43:08 +08:00
committed by GitHub
parent 25e734b274
commit 5ccf0bddc7

View File

@@ -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)
}