From bf857f07da8dcb8ac922fca927fb48e58da50753 Mon Sep 17 00:00:00 2001 From: runkecheng <1131648942@qq.com> Date: Thu, 25 Nov 2021 15:54:29 +0800 Subject: [PATCH] syncer: Set the health label to no before updating pod. #310 --- mysqlcluster/syncer/statefulset.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysqlcluster/syncer/statefulset.go b/mysqlcluster/syncer/statefulset.go index 31c8d3850..d5ad14768 100644 --- a/mysqlcluster/syncer/statefulset.go +++ b/mysqlcluster/syncer/statefulset.go @@ -580,6 +580,10 @@ func (s *StatefulSetSyncer) applyNWait(ctx context.Context, pod *corev1.Pod) err if pod.DeletionTimestamp != nil { log.Info("pod is being deleted", "pod", pod.Name, "key", s.Unwrap()) } else { + pod.ObjectMeta.Labels["healthy"] = "no" + if err := s.cli.Update(ctx, pod); err != nil { + return err + } if err := s.cli.Delete(ctx, pod); err != nil { return err }