mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 08:55:55 -04:00
abort if namespace doesn't exist or terminating
This commit is contained in:
parent
fe48ad8d22
commit
2c378beb64
1 changed files with 4 additions and 0 deletions
|
|
@ -187,6 +187,10 @@ func (c *Publisher) syncNamespace(ns string) error {
|
|||
"ca.crt": string(c.rootCA),
|
||||
},
|
||||
}, metav1.CreateOptions{})
|
||||
// don't retry a create if the namespace doesn't exist or is terminating
|
||||
if apierrors.IsNotFound(err) || apierrors.HasStatusCause(err, v1.NamespaceTerminatingCause) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
case err != nil:
|
||||
return err
|
||||
|
|
|
|||
Loading…
Reference in a new issue