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 aditighag committed Jan 3, 2023
1 parent ee5ba8d commit d4e01ab
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 d4e01ab

Please sign in to comment.