diff --git a/e2e/rbd.go b/e2e/rbd.go index e912b212c..83751745f 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -753,7 +753,7 @@ var _ = Describe("RBD", func() { By("create a PVC clone and bind it to an app", func() { // snapshot beta is only supported from v1.17+ if k8sVersionGreaterEquals(f.ClientSet, 1, 17) { - validatePVCSnapshot(defaultCloneCount, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, "", false, f) + validatePVCSnapshot(defaultCloneCount, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, "", f) } }) @@ -782,7 +782,7 @@ var _ = Describe("RBD", func() { e2elog.Failf("failed to create storageclass with error %v", err) } - validatePVCSnapshot(1, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, "vault", true, f) + validatePVCSnapshot(1, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, "vault", f) err = deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { diff --git a/e2e/utils.go b/e2e/utils.go index cb2d18a37..81e1e5730 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -668,7 +668,7 @@ func validatePVCClone(totalCount int, sourcePvcPath, sourceAppPath, clonePvcPath } // nolint:gocyclo,gocognit,nestif // reduce complexity -func validatePVCSnapshot(totalCount int, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, kms string, validateEncryption bool, f *framework.Framework) { +func validatePVCSnapshot(totalCount int, pvcPath, appPath, snapshotPath, pvcClonePath, appClonePath, kms string, f *framework.Framework) { var wg sync.WaitGroup wgErrs := make([]error, totalCount) chErrs := make([]error, totalCount) @@ -720,7 +720,7 @@ func validatePVCSnapshot(totalCount int, pvcPath, appPath, snapshotPath, pvcClon go func(w *sync.WaitGroup, n int, s v1beta1.VolumeSnapshot) { s.Name = fmt.Sprintf("%s%d", f.UniqueName, n) wgErrs[n] = createSnapshot(&s, deployTimeout) - if wgErrs[n] == nil && validateEncryption { + if wgErrs[n] == nil && kms != "" { if kmsIsVault(kms) || kms == vaultTokens { content, sErr := getVolumeSnapshotContent(s.Namespace, s.Name) if sErr != nil { @@ -790,7 +790,7 @@ func validatePVCSnapshot(totalCount int, pvcPath, appPath, snapshotPath, pvcClon e2elog.Logf("checksum value didn't match. checksum=%s and checksumclone=%s", checkSum, checkSumClone) } } - if wgErrs[n] == nil && validateEncryption { + if wgErrs[n] == nil && kms != "" { wgErrs[n] = validateEncryptedPVC(f, &p, &a) } w.Done() @@ -893,7 +893,7 @@ func validatePVCSnapshot(totalCount int, pvcPath, appPath, snapshotPath, pvcClon s.Name = fmt.Sprintf("%s%d", f.UniqueName, n) content := &v1beta1.VolumeSnapshotContent{} var err error - if validateEncryption { + if kms != "" { if kmsIsVault(kms) || kms == vaultTokens { content, err = getVolumeSnapshotContent(s.Namespace, s.Name) if err != nil { @@ -903,7 +903,7 @@ func validatePVCSnapshot(totalCount int, pvcPath, appPath, snapshotPath, pvcClon } if wgErrs[n] == nil { wgErrs[n] = deleteSnapshot(&s, deployTimeout) - if wgErrs[n] == nil && validateEncryption { + if wgErrs[n] == nil && kms != "" { if kmsIsVault(kms) || kms == vaultTokens { // check passphrase deleted stdOut, _ := readVaultSecret(*content.Status.SnapshotHandle, kmsIsVault(kms), f)