Skip to content

Commit

Permalink
Return a clear error when deleting an immortal namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
feihujiang committed Oct 21, 2015
1 parent c4779fb commit c5f7278
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/pkg/admission/namespace/lifecycle/admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (l *lifecycle) Admit(a admission.Attributes) (err error) {

// prevent deletion of immortal namespaces
if a.GetOperation() == admission.Delete && a.GetKind() == "Namespace" && l.immortalNamespaces.Has(a.GetName()) {
return errors.NewForbidden(a.GetKind(), a.GetName(), fmt.Errorf("namespace can never be deleted"))
return errors.NewForbidden(a.GetKind(), a.GetName(), fmt.Errorf("this namespace may not be deleted"))
}

defaultVersion, kind, err := api.RESTMapper.VersionAndKindForResource(a.GetResource())
Expand Down

0 comments on commit c5f7278

Please sign in to comment.