Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shunki-fujita committed Nov 15, 2024
1 parent f15b35c commit fd23210
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clustering/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func (p *managerProcess) removeAnnPreventDelete(ctx context.Context, ss *StatusS
if _, exists := pod.Annotations[constants.AnnPreventDelete]; exists {
newPod := pod.DeepCopy()
delete(newPod.Annotations, constants.AnnPreventDelete)
log(ctx).Info("replication delay resolved, allow pod deletion", "pod", pod.Name)
log.Info("replication delay resolved, allow pod deletion", "pod", pod.Name)
if err := p.client.Patch(ctx, newPod, client.MergeFrom(pod)); err != nil {
return fmt.Errorf("failed to remove moco.cybozu.com/prevent-delete annotation: %w", err)
}
Expand All @@ -339,7 +339,7 @@ func (p *managerProcess) addAnnPreventDelete(ctx context.Context, ss *StatusSet)
}
if _, exists := newPod.Annotations[constants.AnnPreventDelete]; !exists {
newPod.Annotations[constants.AnnPreventDelete] = "true"
log(ctx).Info("replication delay detected, prevent pod deletion", "pod", ppod.Name)
log.Info("replication delay detected, prevent pod deletion", "pod", ppod.Name)
if err := p.client.Patch(ctx, newPod, client.MergeFrom(ppod)); err != nil {
return fmt.Errorf("failed to add moco.cybozu.com/prevent-delete annotation: %w", err)
}
Expand Down

0 comments on commit fd23210

Please sign in to comment.