Skip to content

Commit

Permalink
feat: add process log
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Jan 7, 2025
1 parent bec2852 commit 948f790
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/driver/hook/prestop.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"sync"
"time"

"github.com/rs/zerolog/log"
v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -127,8 +128,14 @@ func (h *hook) waitForVolumeAttachmentsCleanup(ctx context.Context) error {
Err(err).
Msg("An error occurred while checking the existence of VolumeAttachments, waiting for VolumeAttachments to be deleted")

tick := time.NewTicker(time.Second)
defer tick.Stop()

select {
case <-informerCh:
case <-tick.C:
log.Info().
Msg("Waiting for VolumeAttachments to be deleted")
case <-ctx.Done():
log.Error().
Err(ctx.Err()).
Expand Down

0 comments on commit 948f790

Please sign in to comment.