Merge pull request #14353 from feihujiang/fixErrorMessageForNonExistentNamespace

Fix error message for non-existent namespace
This commit is contained in:
Brian Grant 2015-09-25 10:59:24 -07:00
commit a6461a51d5

View File

@ -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)
}
}