Skip to content

Commit

Permalink
fix: bugfix condition check
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Dec 25, 2024
1 parent e294381 commit bec2852
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/driver/hook/prestop.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ func (h *hook) PreStop(ctx context.Context) error {
log.Info().
Str("node_name", h.nodeName).
Msg("Node does not found, assuming the termination event, the node might be in the process of being removed")
}

isDrained := true
if !isNodeDrained(node) {
isDrained = false
} else if !isNodeDrained(node) {
log.Info().
Str("node_name", h.nodeName).
Msg("Node is not being drained, skipping VolumeAttachments cleanup check")
Expand All @@ -46,7 +42,6 @@ func (h *hook) PreStop(ctx context.Context) error {

log.Info().
Str("node_name", h.nodeName).
Bool("is_drained", isDrained).
Msg("Node is being drained or removed, starting the wait for VolumeAttachments cleanup")

if err := h.waitForVolumeAttachmentsCleanup(ctx); err != nil {
Expand Down

0 comments on commit bec2852

Please sign in to comment.