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

@ -375,7 +375,14 @@ func deletePod(name, ns string, c kubernetes.Interface, t int) error {
}
func deletePodWithLabel(label, ns string, skipNotFound bool) error {
_, err := framework.RunKubectl(ns, "delete", "po", "-l", label, fmt.Sprintf("--ignore-not-found=%t", skipNotFound))
err := retryKubectlArgs(
ns,
kubectlDelete,
deployTimeout,
"po",
"-l",
label,
fmt.Sprintf("--ignore-not-found=%t", skipNotFound))
if err != nil {
e2elog.Logf("failed to delete pod %v", err)
}