e2e: retry running kubectl on known errors

By using retryKubectl helper function,
a retry will be done, and the known error
messages will be skipped.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2021-07-28 09:21:18 +05:30
committed by mergify[bot]
parent 2071c535fa
commit 2c66dfc3e4
5 changed files with 32 additions and 25 deletions

View File

@ -8,7 +8,6 @@ import (
. "github.com/onsi/gomega" // nolint
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/test/e2e/framework"
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
)
@ -25,13 +24,12 @@ var (
func deployVault(c kubernetes.Interface, deployTimeout int) {
// hack to make helm E2E pass as helm charts creates this configmap as part
// of cephcsi deployment
_, err := framework.RunKubectl(
err := retryKubectlArgs(
cephCSINamespace,
"delete",
kubectlDelete,
deployTimeout,
"cm",
"ceph-csi-encryption-kms-config",
"--namespace",
cephCSINamespace,
"--ignore-not-found=true")
Expect(err).Should(BeNil())