From 18f35de305bee5e491f3b8a650bf5a50591bafc4 Mon Sep 17 00:00:00 2001 From: Tesshu Flower Date: Tue, 14 Jan 2025 13:53:50 -0500 Subject: [PATCH 1/2] dest snapshot wait for readyToUse=true Signed-off-by: Tesshu Flower --- controllers/volumehandler/volumehandler.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controllers/volumehandler/volumehandler.go b/controllers/volumehandler/volumehandler.go index d9eebce01..406103b18 100644 --- a/controllers/volumehandler/volumehandler.go +++ b/controllers/volumehandler/volumehandler.go @@ -301,6 +301,13 @@ func (vh *VolumeHandler) ensureImageSnapshot(ctx context.Context, log logr.Logge } return nil, nil } + if snap.Status.ReadyToUse != nil && !*snap.Status.ReadyToUse { + // readyToUse is set to false for this volume snapshot + logger.V(1).Info("waiting for snapshot to be ready") + return nil, nil + } + // status.readyToUse either is not set by the driver at this point (even though + // status.BoundVolumeSnapshotContentName is set), or readyToUse=true return snap, nil } From 1c28f2506ed383f59eec09ecbb80bdbcdeb4d8f2 Mon Sep 17 00:00:00 2001 From: Tesshu Flower Date: Thu, 16 Jan 2025 12:02:58 -0500 Subject: [PATCH 2/2] debug logging Signed-off-by: Tesshu Flower --- controllers/volumehandler/volumehandler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/volumehandler/volumehandler.go b/controllers/volumehandler/volumehandler.go index 406103b18..0608a412a 100644 --- a/controllers/volumehandler/volumehandler.go +++ b/controllers/volumehandler/volumehandler.go @@ -301,11 +301,13 @@ func (vh *VolumeHandler) ensureImageSnapshot(ctx context.Context, log logr.Logge } return nil, nil } + logger.V(1).Info("snapshot content is bound") if snap.Status.ReadyToUse != nil && !*snap.Status.ReadyToUse { // readyToUse is set to false for this volume snapshot logger.V(1).Info("waiting for snapshot to be ready") return nil, nil } + logger.V(1).Info("snapshot is ready to use") // status.readyToUse either is not set by the driver at this point (even though // status.BoundVolumeSnapshotContentName is set), or readyToUse=true