@@ -111,6 +111,7 @@ func CreateSnapshotResource(ctx context.Context, sDriver SnapshottableTestDriver
111
111
framework .Logf ("Recording snapshot content annotations: %v" , snapshotContentAnnotations )
112
112
csiDriverName := r .Vsclass .Object ["driver" ].(string )
113
113
framework .Logf ("Recording snapshot driver: %s" , csiDriverName )
114
+ snapshotClassName := r .Vsclass .GetName ()
114
115
115
116
// If the deletion policy is retain on vscontent:
116
117
// when vs is deleted vscontent will not be deleted
@@ -143,7 +144,7 @@ func CreateSnapshotResource(ctx context.Context, sDriver SnapshottableTestDriver
143
144
snapName := getPreProvisionedSnapshotName (uuid )
144
145
snapcontentName := getPreProvisionedSnapshotContentName (uuid )
145
146
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 )
147
148
r .Vscontent , err = dc .Resource (utils .SnapshotContentGVR ).Create (ctx , r .Vscontent , metav1.CreateOptions {})
148
149
framework .ExpectNoError (err )
149
150
@@ -302,7 +303,7 @@ func getPreProvisionedSnapshot(snapName, ns, snapshotContentName string) *unstru
302
303
303
304
return snapshot
304
305
}
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 {
306
307
snapshotContent := & unstructured.Unstructured {
307
308
Object : map [string ]interface {}{
308
309
"kind" : "VolumeSnapshotContent" ,
@@ -315,6 +316,7 @@ func getPreProvisionedSnapshotContent(snapcontentName string, snapshotContentAnn
315
316
"source" : map [string ]interface {}{
316
317
"snapshotHandle" : snapshotHandle ,
317
318
},
319
+ "volumeSnapshotClassName" : snapshotClassName ,
318
320
"volumeSnapshotRef" : map [string ]interface {}{
319
321
"name" : snapshotName ,
320
322
"namespace" : snapshotNamespace ,
0 commit comments