mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Fix error message for non-existent namespace
This commit is contained in:
parent
45a8b5f98a
commit
74ba88cb07
@ -82,7 +82,10 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) {
|
||||
// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
|
||||
namespaceObj, err = l.client.Namespaces().Get(a.GetNamespace())
|
||||
if err != nil {
|
||||
return admission.NewNotFound(a)
|
||||
if errors.IsNotFound(err) {
|
||||
return err
|
||||
}
|
||||
return errors.NewInternalError(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user