Skip to content

Commit 380c00d

Browse files
authored
Merge pull request kubernetes#127805 from venkatsc/fix_e2e_127804
Fix pre-provisioned snapshots e2e test
2 parents fccbbf3 + 0cd878d commit 380c00d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/e2e/storage/framework/snapshot_resource.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func CreateSnapshotResource(ctx context.Context, sDriver SnapshottableTestDriver
111111
framework.Logf("Recording snapshot content annotations: %v", snapshotContentAnnotations)
112112
csiDriverName := r.Vsclass.Object["driver"].(string)
113113
framework.Logf("Recording snapshot driver: %s", csiDriverName)
114+
snapshotClassName := r.Vsclass.GetName()
114115

115116
// If the deletion policy is retain on vscontent:
116117
// when vs is deleted vscontent will not be deleted
@@ -143,7 +144,7 @@ func CreateSnapshotResource(ctx context.Context, sDriver SnapshottableTestDriver
143144
snapName := getPreProvisionedSnapshotName(uuid)
144145
snapcontentName := getPreProvisionedSnapshotContentName(uuid)
145146

146-
r.Vscontent = getPreProvisionedSnapshotContent(snapcontentName, snapshotContentAnnotations, snapName, pvcNamespace, snapshotHandle, pattern.SnapshotDeletionPolicy.String(), csiDriverName)
147+
r.Vscontent = getPreProvisionedSnapshotContent(snapcontentName, snapshotClassName, snapshotContentAnnotations, snapName, pvcNamespace, snapshotHandle, pattern.SnapshotDeletionPolicy.String(), csiDriverName)
147148
r.Vscontent, err = dc.Resource(utils.SnapshotContentGVR).Create(ctx, r.Vscontent, metav1.CreateOptions{})
148149
framework.ExpectNoError(err)
149150

@@ -302,7 +303,7 @@ func getPreProvisionedSnapshot(snapName, ns, snapshotContentName string) *unstru
302303

303304
return snapshot
304305
}
305-
func getPreProvisionedSnapshotContent(snapcontentName string, snapshotContentAnnotations map[string]string, snapshotName, snapshotNamespace, snapshotHandle, deletionPolicy, csiDriverName string) *unstructured.Unstructured {
306+
func getPreProvisionedSnapshotContent(snapcontentName, snapshotClassName string, snapshotContentAnnotations map[string]string, snapshotName, snapshotNamespace, snapshotHandle, deletionPolicy, csiDriverName string) *unstructured.Unstructured {
306307
snapshotContent := &unstructured.Unstructured{
307308
Object: map[string]interface{}{
308309
"kind": "VolumeSnapshotContent",
@@ -315,6 +316,7 @@ func getPreProvisionedSnapshotContent(snapcontentName string, snapshotContentAnn
315316
"source": map[string]interface{}{
316317
"snapshotHandle": snapshotHandle,
317318
},
319+
"volumeSnapshotClassName": snapshotClassName,
318320
"volumeSnapshotRef": map[string]interface{}{
319321
"name": snapshotName,
320322
"namespace": snapshotNamespace,

0 commit comments

Comments
 (0)