Skip to content

Commit

Permalink
syncer: Set the health label to no before updating pod. radondb#310
Browse files Browse the repository at this point in the history
  • Loading branch information
runkecheng committed Nov 29, 2021
1 parent 98a9110 commit bf857f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mysqlcluster/syncer/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit bf857f0

Please sign in to comment.