From 80da461458b729241346600a1021bcf41b208ff5 Mon Sep 17 00:00:00 2001 From: weeix Date: Thu, 28 Aug 2025 12:33:16 +0700 Subject: [PATCH] clarify VolumeSnapshotClass error for mismatched driver/provisioner Signed-off-by: weeix --- pkg/util/csi/volume_snapshot.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/util/csi/volume_snapshot.go b/pkg/util/csi/volume_snapshot.go index 7d00664cd..8e59dd69f 100644 --- a/pkg/util/csi/volume_snapshot.go +++ b/pkg/util/csi/volume_snapshot.go @@ -447,8 +447,13 @@ func GetVolumeSnapshotClassForStorageClass( return &vsClass, nil } return nil, fmt.Errorf( - "failed to get VolumeSnapshotClass for provisioner %s, ensure that the desired VolumeSnapshot class has the %s label or %s annotation", - provisioner, velerov1api.VolumeSnapshotClassSelectorLabel, velerov1api.VolumeSnapshotClassKubernetesAnnotation) + "failed to get VolumeSnapshotClass for provisioner %s: "+ + "ensure that the desired VolumeSnapshotClass has the %s label or %s annotation, "+ + "and that its driver matches the StorageClass provisioner", + provisioner, + velerov1api.VolumeSnapshotClassSelectorLabel, + velerov1api.VolumeSnapshotClassKubernetesAnnotation, + ) } // IsVolumeSnapshotClassHasListerSecret returns whether a volumesnapshotclass has a snapshotlister secret