diff --git a/pkg/registry/core/pod/storage/storage.go b/pkg/registry/core/pod/storage/storage.go index 4a10f4fd35e..2ec0f3c5615 100644 --- a/pkg/registry/core/pod/storage/storage.go +++ b/pkg/registry/core/pod/storage/storage.go @@ -280,12 +280,6 @@ func (r *LegacyBindingREST) Destroy() { // we don't destroy it here explicitly. } -var _ rest.SingularNameProvider = &LegacyBindingREST{} - -func (r *LegacyBindingREST) GetSingularName() string { - return r.bindingRest.GetSingularName() + "/binding" -} - // Create ensures a pod is bound to a specific host. func (r *LegacyBindingREST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (out runtime.Object, err error) { metadata, err := meta.Accessor(obj) diff --git a/pkg/registry/rbac/clusterrole/policybased/storage.go b/pkg/registry/rbac/clusterrole/policybased/storage.go index 02ba90a9597..1e113cd9e07 100644 --- a/pkg/registry/rbac/clusterrole/policybased/storage.go +++ b/pkg/registry/rbac/clusterrole/policybased/storage.go @@ -128,5 +128,9 @@ func hasAggregationRule(clusterRole *rbac.ClusterRole) bool { var _ rest.SingularNameProvider = &Storage{} func (s *Storage) GetSingularName() string { - return "clusterrole" + svp, ok := s.StandardStorage.(rest.SingularNameProvider) + if !ok { + return "" + } + return svp.GetSingularName() } diff --git a/pkg/registry/rbac/clusterrolebinding/policybased/storage.go b/pkg/registry/rbac/clusterrolebinding/policybased/storage.go index 3ddf0c597c4..1c3cd3431f3 100644 --- a/pkg/registry/rbac/clusterrolebinding/policybased/storage.go +++ b/pkg/registry/rbac/clusterrolebinding/policybased/storage.go @@ -131,5 +131,9 @@ func (s *Storage) Update(ctx context.Context, name string, obj rest.UpdatedObjec var _ rest.SingularNameProvider = &Storage{} func (s *Storage) GetSingularName() string { - return "clusterrolebinding" + svp, ok := s.StandardStorage.(rest.SingularNameProvider) + if !ok { + return "" + } + return svp.GetSingularName() } diff --git a/pkg/registry/rbac/role/policybased/storage.go b/pkg/registry/rbac/role/policybased/storage.go index 97743dabde4..36ac26dd3e9 100644 --- a/pkg/registry/rbac/role/policybased/storage.go +++ b/pkg/registry/rbac/role/policybased/storage.go @@ -103,5 +103,9 @@ func (s *Storage) Update(ctx context.Context, name string, obj rest.UpdatedObjec var _ rest.SingularNameProvider = &Storage{} func (s *Storage) GetSingularName() string { - return "role" + svp, ok := s.StandardStorage.(rest.SingularNameProvider) + if !ok { + return "" + } + return svp.GetSingularName() } diff --git a/pkg/registry/rbac/rolebinding/policybased/storage.go b/pkg/registry/rbac/rolebinding/policybased/storage.go index 48177edf81d..10e1a656201 100644 --- a/pkg/registry/rbac/rolebinding/policybased/storage.go +++ b/pkg/registry/rbac/rolebinding/policybased/storage.go @@ -146,5 +146,9 @@ func (s *Storage) Update(ctx context.Context, name string, obj rest.UpdatedObjec var _ rest.SingularNameProvider = &Storage{} func (s *Storage) GetSingularName() string { - return "rolebinding" + svp, ok := s.StandardStorage.(rest.SingularNameProvider) + if !ok { + return "" + } + return svp.GetSingularName() }