Fix error message for non-existent namespace

This commit is contained in:
feihujiang 2015-09-22 20:23:23 +08:00
parent 45a8b5f98a
commit 74ba88cb07

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