mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
e2e: use retryKubectlFile() for creating & deleting secrets
Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
0744ad502b
commit
8ca7a35820
25
e2e/rbd.go
25
e2e/rbd.go
@ -815,11 +815,7 @@ var _ = Describe("RBD", func() {
|
|||||||
namespace := cephCSINamespace
|
namespace := cephCSINamespace
|
||||||
|
|
||||||
// create user Secret
|
// create user Secret
|
||||||
secret, err := getSecret(vaultExamplePath + "user-secret.yaml")
|
err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+"user-secret.yaml", deployTimeout)
|
||||||
if err != nil {
|
|
||||||
e2elog.Failf("failed to load user Secret: %v", err)
|
|
||||||
}
|
|
||||||
_, err = c.CoreV1().Secrets(namespace).Create(context.TODO(), &secret, metav1.CreateOptions{})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Failf("failed to create user Secret: %v", err)
|
e2elog.Failf("failed to create user Secret: %v", err)
|
||||||
}
|
}
|
||||||
@ -832,7 +828,11 @@ var _ = Describe("RBD", func() {
|
|||||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||||
|
|
||||||
// delete user secret
|
// delete user secret
|
||||||
err = c.CoreV1().Secrets(namespace).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{})
|
err = retryKubectlFile(namespace,
|
||||||
|
kubectlDelete,
|
||||||
|
vaultExamplePath+"user-secret.yaml",
|
||||||
|
deployTimeout,
|
||||||
|
"--ignore-not-found=true")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Failf("failed to delete user Secret: %v", err)
|
e2elog.Failf("failed to delete user Secret: %v", err)
|
||||||
}
|
}
|
||||||
@ -867,11 +867,7 @@ var _ = Describe("RBD", func() {
|
|||||||
namespace := f.UniqueName
|
namespace := f.UniqueName
|
||||||
|
|
||||||
// create user Secret
|
// create user Secret
|
||||||
secret, err := getSecret(vaultExamplePath + "user-secret.yaml")
|
err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+"user-secret.yaml", deployTimeout)
|
||||||
if err != nil {
|
|
||||||
e2elog.Failf("failed to load user Secret: %v", err)
|
|
||||||
}
|
|
||||||
_, err = c.CoreV1().Secrets(namespace).Create(context.TODO(), &secret, metav1.CreateOptions{})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Failf("failed to create user Secret: %v", err)
|
e2elog.Failf("failed to create user Secret: %v", err)
|
||||||
}
|
}
|
||||||
@ -884,7 +880,12 @@ var _ = Describe("RBD", func() {
|
|||||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||||
|
|
||||||
// delete user secret
|
// delete user secret
|
||||||
err = c.CoreV1().Secrets(namespace).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{})
|
err = retryKubectlFile(
|
||||||
|
namespace,
|
||||||
|
kubectlDelete,
|
||||||
|
vaultExamplePath+"user-secret.yaml",
|
||||||
|
deployTimeout,
|
||||||
|
"--ignore-not-found=true")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e2elog.Failf("failed to delete user Secret: %v", err)
|
e2elog.Failf("failed to delete user Secret: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user