mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Merge pull request #14353 from feihujiang/fixErrorMessageForNonExistentNamespace
Fix error message for non-existent namespace
This commit is contained in:
commit
a6461a51d5
@ -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