@@ -104,10 +104,13 @@ func CreateSnapshotResource(sDriver SnapshottableTestDriver, config *PerTestConf
104
104
r .Vscontent , err = dc .Resource (utils .SnapshotContentGVR ).Update (context .TODO (), r .Vscontent , metav1.UpdateOptions {})
105
105
framework .ExpectNoError (err )
106
106
107
- ginkgo .By ("recording the volume handle and snapshotHandle " )
107
+ ginkgo .By ("recording properties of the preprovisioned snapshot " )
108
108
snapshotHandle := r .Vscontent .Object ["status" ].(map [string ]interface {})["snapshotHandle" ].(string )
109
- framework .Logf ("Recording snapshot handle: %s" , snapshotHandle )
109
+ framework .Logf ("Recording snapshot content handle: %s" , snapshotHandle )
110
+ snapshotContentAnnotations := r .Vscontent .GetAnnotations ()
111
+ framework .Logf ("Recording snapshot content annotations: %v" , snapshotContentAnnotations )
110
112
csiDriverName := r .Vsclass .Object ["driver" ].(string )
113
+ framework .Logf ("Recording snapshot driver: %s" , csiDriverName )
111
114
112
115
// If the deletion policy is retain on vscontent:
113
116
// when vs is deleted vscontent will not be deleted
@@ -140,7 +143,7 @@ func CreateSnapshotResource(sDriver SnapshottableTestDriver, config *PerTestConf
140
143
snapName := getPreProvisionedSnapshotName (uuid )
141
144
snapcontentName := getPreProvisionedSnapshotContentName (uuid )
142
145
143
- r .Vscontent = getPreProvisionedSnapshotContent (snapcontentName , snapName , pvcNamespace , snapshotHandle , pattern .SnapshotDeletionPolicy .String (), csiDriverName )
146
+ r .Vscontent = getPreProvisionedSnapshotContent (snapcontentName , snapshotContentAnnotations , snapName , pvcNamespace , snapshotHandle , pattern .SnapshotDeletionPolicy .String (), csiDriverName )
144
147
r .Vscontent , err = dc .Resource (utils .SnapshotContentGVR ).Create (context .TODO (), r .Vscontent , metav1.CreateOptions {})
145
148
framework .ExpectNoError (err )
146
149
@@ -299,13 +302,14 @@ func getPreProvisionedSnapshot(snapName, ns, snapshotContentName string) *unstru
299
302
300
303
return snapshot
301
304
}
302
- func getPreProvisionedSnapshotContent (snapcontentName , snapshotName , snapshotNamespace , snapshotHandle , deletionPolicy , csiDriverName string ) * unstructured.Unstructured {
305
+ func getPreProvisionedSnapshotContent (snapcontentName string , snapshotContentAnnotations map [ string ] string , snapshotName , snapshotNamespace , snapshotHandle , deletionPolicy , csiDriverName string ) * unstructured.Unstructured {
303
306
snapshotContent := & unstructured.Unstructured {
304
307
Object : map [string ]interface {}{
305
308
"kind" : "VolumeSnapshotContent" ,
306
309
"apiVersion" : utils .SnapshotAPIVersion ,
307
310
"metadata" : map [string ]interface {}{
308
- "name" : snapcontentName ,
311
+ "name" : snapcontentName ,
312
+ "annotations" : snapshotContentAnnotations ,
309
313
},
310
314
"spec" : map [string ]interface {}{
311
315
"source" : map [string ]interface {}{
0 commit comments