Skip to content

Commit

Permalink
Merge pull request #560 from cybozu-go/fix-log
Browse files Browse the repository at this point in the history
Fix log message when demote annotation is added
  • Loading branch information
masa213f authored Sep 1, 2023
2 parents 7ac0e96 + 00cc66b commit 720adf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion controllers/pod_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ func (r *PodWatcher) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
return ctrl.Result{}, nil
}

log.Info("detected mysql pod deletion", "name", pod.Name)
if pod.DeletionTimestamp != nil {
log.Info("detected mysql pod deletion", "name", pod.Name)
} else {
log.Info("detected demote annotation", "name", pod.Name)
}
r.ClusterManager.UpdateNoStart(types.NamespacedName{Namespace: pod.Namespace, Name: ref.Name}, string(controller.ReconcileIDFromContext(ctx)))
return ctrl.Result{}, nil
}
Expand Down

0 comments on commit 720adf8

Please sign in to comment.