Skip to content

Commit

Permalink
[connectivity] Retry deleting namespace while waiting
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Ledvina <[email protected]>
  • Loading branch information
jaredledvina authored and tklauser committed Jul 26, 2022
1 parent 26e8c89 commit ddc03cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connectivity/check/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,9 @@ func (ct *ConnectivityTest) deleteDeployments(ctx context.Context, client *k8s.C
ct.Logf("⌛ [%s] Waiting for namespace %s to disappear", client.ClusterName(), ct.params.TestNamespace)
for err == nil {
time.Sleep(time.Second)
// Retry the namespace deletion in-case the previous delete was
// rejected, i.e. by yahoo/k8s-namespace-guard
_ = client.DeleteNamespace(ctx, ct.params.TestNamespace, metav1.DeleteOptions{})
_, err = client.GetNamespace(ctx, ct.params.TestNamespace, metav1.GetOptions{})
}
}
Expand Down

0 comments on commit ddc03cf

Please sign in to comment.