From 948f7903adcdfba4e233b796d698a78cb4815a37 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 7 Jan 2025 16:41:45 +0900 Subject: [PATCH] feat: add process log Signed-off-by: hlts2 --- pkg/driver/hook/prestop.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/driver/hook/prestop.go b/pkg/driver/hook/prestop.go index 2638bee..3daf304 100644 --- a/pkg/driver/hook/prestop.go +++ b/pkg/driver/hook/prestop.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "sync" + "time" "github.com/rs/zerolog/log" v1 "k8s.io/api/core/v1" @@ -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()).