mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #96277 from zshihang/fix
abort if namespace doesn't exist or terminating
This commit is contained in:
commit
e609b7164b
@ -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 New Issue
Block a user