mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-21 09:34:40 +00:00
Remove snapshot class from prepv test because it is not needed.
Prepv snapshots only need to specify driver.
This commit is contained in:
parent
42b2d1c52c
commit
854645d7c3
@ -591,7 +591,7 @@ func getPreProvisionedSnapshot(snapshotContentName, ns, snapshotHandle string) *
|
|||||||
|
|
||||||
return snapshot
|
return snapshot
|
||||||
}
|
}
|
||||||
func getPreProvisionedSnapshotContent(snapshotName, snapshotNamespace, snapshotHandle, deletionPolicy, csiDriverName, volumeSnapshotClassName string) *unstructured.Unstructured {
|
func getPreProvisionedSnapshotContent(snapshotName, snapshotNamespace, snapshotHandle, deletionPolicy, csiDriverName string) *unstructured.Unstructured {
|
||||||
snapshotContent := &unstructured.Unstructured{
|
snapshotContent := &unstructured.Unstructured{
|
||||||
Object: map[string]interface{}{
|
Object: map[string]interface{}{
|
||||||
"kind": "VolumeSnapshotContent",
|
"kind": "VolumeSnapshotContent",
|
||||||
@ -607,9 +607,8 @@ func getPreProvisionedSnapshotContent(snapshotName, snapshotNamespace, snapshotH
|
|||||||
"name": snapshotName,
|
"name": snapshotName,
|
||||||
"namespace": snapshotNamespace,
|
"namespace": snapshotNamespace,
|
||||||
},
|
},
|
||||||
"driver": csiDriverName,
|
"driver": csiDriverName,
|
||||||
"deletionPolicy": deletionPolicy,
|
"deletionPolicy": deletionPolicy,
|
||||||
"volumeSnapshotClassName": volumeSnapshotClassName,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,10 @@ func (s *snapshottableTestSuite) DefineTests(driver TestDriver, pattern testpatt
|
|||||||
|
|
||||||
// Check SnapshotContent properties
|
// Check SnapshotContent properties
|
||||||
ginkgo.By("checking the SnapshotContent")
|
ginkgo.By("checking the SnapshotContent")
|
||||||
framework.ExpectEqual(snapshotContentSpec["volumeSnapshotClassName"], vsc.GetName())
|
// PreprovisionedCreatedSnapshot do not need to set volume snapshot class name
|
||||||
|
if pattern.SnapshotType != testpatterns.PreprovisionedCreatedSnapshot {
|
||||||
|
framework.ExpectEqual(snapshotContentSpec["volumeSnapshotClassName"], vsc.GetName())
|
||||||
|
}
|
||||||
framework.ExpectEqual(volumeSnapshotRef["name"], vs.GetName())
|
framework.ExpectEqual(volumeSnapshotRef["name"], vs.GetName())
|
||||||
framework.ExpectEqual(volumeSnapshotRef["namespace"], vs.GetNamespace())
|
framework.ExpectEqual(volumeSnapshotRef["namespace"], vs.GetNamespace())
|
||||||
|
|
||||||
@ -451,7 +454,7 @@ func CreateSnapshotResource(sDriver SnapshottableTestDriver, config *PerTestConf
|
|||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
ginkgo.By("creating a snapshot content with the snapshot handle")
|
ginkgo.By("creating a snapshot content with the snapshot handle")
|
||||||
r.Vscontent = getPreProvisionedSnapshotContent(getPreProvisionedSnapshotName(snapshotHandle), pvcNamespace, snapshotHandle, pattern.SnapshotDeletionPolicy.String(), csiDriverName, r.Vsclass.GetName())
|
r.Vscontent = getPreProvisionedSnapshotContent(getPreProvisionedSnapshotName(snapshotHandle), pvcNamespace, snapshotHandle, pattern.SnapshotDeletionPolicy.String(), csiDriverName)
|
||||||
r.Vscontent, err = dc.Resource(SnapshotContentGVR).Create(context.TODO(), r.Vscontent, metav1.CreateOptions{})
|
r.Vscontent, err = dc.Resource(SnapshotContentGVR).Create(context.TODO(), r.Vscontent, metav1.CreateOptions{})
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user