Commit a6461a51 authored by Brian Grant's avatar Brian Grant

Merge pull request #14353 from feihujiang/fixErrorMessageForNonExistentNamespace

Fix error message for non-existent namespace
parents f9e4a6f6 74ba88cb
...@@ -82,7 +82,10 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) { ...@@ -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 // 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()) namespaceObj, err = l.client.Namespaces().Get(a.GetNamespace())
if err != nil { if err != nil {
return admission.NewNotFound(a) if errors.IsNotFound(err) {
return err
}
return errors.NewInternalError(err)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment