mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Merge pull request #127805 from venkatsc/fix_e2e_127804
Fix pre-provisioned snapshots e2e test
This commit is contained in:
commit
380c00d58f
@ -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
|
||||
@ -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)
|
||||
|
||||
@ -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",
|
||||
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user