Skip to content

Commit

Permalink
Merge pull request kubernetes#127805 from venkatsc/fix_e2e_127804
Browse files Browse the repository at this point in the history
Fix pre-provisioned snapshots e2e test
  • Loading branch information
k8s-ci-robot authored Oct 2, 2024
2 parents fccbbf3 + 0cd878d commit 380c00d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/e2e/storage/framework/snapshot_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func CreateSnapshotResource(ctx context.Context, sDriver SnapshottableTestDriver
framework.Logf("Recording snapshot content annotations: %v", snapshotContentAnnotations)
csiDriverName := r.Vsclass.Object["driver"].(string)
framework.Logf("Recording snapshot driver: %s", csiDriverName)
snapshotClassName := r.Vsclass.GetName()

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

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

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

return snapshot
}
func getPreProvisionedSnapshotContent(snapcontentName string, snapshotContentAnnotations map[string]string, snapshotName, snapshotNamespace, snapshotHandle, deletionPolicy, csiDriverName string) *unstructured.Unstructured {
func getPreProvisionedSnapshotContent(snapcontentName, snapshotClassName string, snapshotContentAnnotations map[string]string, snapshotName, snapshotNamespace, snapshotHandle, deletionPolicy, csiDriverName string) *unstructured.Unstructured {
snapshotContent := &unstructured.Unstructured{
Object: map[string]interface{}{
"kind": "VolumeSnapshotContent",
Expand All @@ -315,6 +316,7 @@ func getPreProvisionedSnapshotContent(snapcontentName string, snapshotContentAnn
"source": map[string]interface{}{
"snapshotHandle": snapshotHandle,
},
"volumeSnapshotClassName": snapshotClassName,
"volumeSnapshotRef": map[string]interface{}{
"name": snapshotName,
"namespace": snapshotNamespace,
Expand Down

0 comments on commit 380c00d

Please sign in to comment.