mirror of https://github.com/k3s-io/k3s
Merge pull request #7780 from derekwaynecarr/incorrect_error
Throw an API error when deleting namespace in terminationpull/6/head
commit
6e031ae01a
|
@ -21,6 +21,7 @@ import (
|
|||
"path"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
apierrors "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/generic"
|
||||
|
@ -101,7 +102,7 @@ func (r *REST) Delete(ctx api.Context, name string, options *api.DeleteOptions)
|
|||
|
||||
// prior to final deletion, we must ensure that finalizers is empty
|
||||
if len(namespace.Spec.Finalizers) != 0 {
|
||||
err = fmt.Errorf("Namespace %v termination is in progress, waiting for %v", namespace.Name, namespace.Spec.Finalizers)
|
||||
err = apierrors.NewConflict("Namespace", namespace.Name, fmt.Errorf("Termination is in progress, waiting for %v", namespace.Spec.Finalizers))
|
||||
return nil, err
|
||||
}
|
||||
return r.Etcd.Delete(ctx, name, nil)
|
||||
|
|
Loading…
Reference in New Issue