Skip to content

Commit

Permalink
Merge pull request #59 from NVIDIA/rm-deprec-method
Browse files Browse the repository at this point in the history
  • Loading branch information
tariq1890 authored Dec 31, 2024
2 parents 13f0cce + aa7dd9a commit 0109ebe
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/upgrade/drain_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ func (m *DrainManagerImpl) ScheduleNodesDrain(ctx context.Context, drainConfig *
GracePeriodSeconds: -1,
Timeout: time.Duration(drainSpec.TimeoutSecond) * time.Second,
PodSelector: drainSpec.PodSelector,
OnPodDeletedOrEvicted: func(pod *corev1.Pod, usingEviction bool) {
verbStr := "Deleted"
if usingEviction {
verbStr = "Evicted"
OnPodDeletionOrEvictionFinished: func(pod *corev1.Pod, usingEviction bool, err error) {
log := m.log.WithValues("using-eviction", usingEviction, "pod", pod.Name, "namespace", pod.Namespace)
if err != nil {
log.V(consts.LogLevelWarning).Info("Drain Pod failed", "error", err)
return
}
m.log.V(consts.LogLevelInfo).Info(fmt.Sprintf("%s pod from Node %s/%s", verbStr, pod.Namespace, pod.Name))
log.V(consts.LogLevelInfo).Info("Drain Pod finished")
},
Out: os.Stdout,
ErrOut: os.Stdout,
Expand Down

0 comments on commit 0109ebe

Please sign in to comment.