mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
e2e: use retryKubectlFile() for creating & deleting secrets
Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 8ca7a35820
)
This commit is contained in:
parent
33899663e1
commit
f97c3f901d
25
e2e/rbd.go
25
e2e/rbd.go
@ -803,11 +803,7 @@ var _ = Describe("RBD", func() {
|
||||
namespace := cephCSINamespace
|
||||
|
||||
// create user Secret
|
||||
secret, err := getSecret(vaultExamplePath + "user-secret.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to load user Secret: %v", err)
|
||||
}
|
||||
_, err = c.CoreV1().Secrets(namespace).Create(context.TODO(), &secret, metav1.CreateOptions{})
|
||||
err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+"user-secret.yaml", deployTimeout)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create user Secret: %v", err)
|
||||
}
|
||||
@ -820,7 +816,11 @@ var _ = Describe("RBD", func() {
|
||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||
|
||||
// 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 {
|
||||
e2elog.Failf("failed to delete user Secret: %v", err)
|
||||
}
|
||||
@ -855,11 +855,7 @@ var _ = Describe("RBD", func() {
|
||||
namespace := f.UniqueName
|
||||
|
||||
// create user Secret
|
||||
secret, err := getSecret(vaultExamplePath + "user-secret.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to load user Secret: %v", err)
|
||||
}
|
||||
_, err = c.CoreV1().Secrets(namespace).Create(context.TODO(), &secret, metav1.CreateOptions{})
|
||||
err = retryKubectlFile(namespace, kubectlCreate, vaultExamplePath+"user-secret.yaml", deployTimeout)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create user Secret: %v", err)
|
||||
}
|
||||
@ -872,7 +868,12 @@ var _ = Describe("RBD", func() {
|
||||
validateRBDImageCount(f, 0, defaultRBDPool)
|
||||
|
||||
// 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 {
|
||||
e2elog.Failf("failed to delete user Secret: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user