Commit 151846db authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #45999 from enj/enj/i/custom_resource_name

Automatic merge from submit-queue Remove ObjectNameFunc from custom resources @deads2k as far as I can tell these `ObjectNameFunc`s are unnecessary. Signed-off-by: 's avatarMonis Khan <mkhan@redhat.com> **Release note**: ``` NONE ```
parents d775ff4c cb132826
......@@ -17,7 +17,6 @@ limitations under the License.
package customresource
import (
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
......@@ -41,13 +40,6 @@ func NewREST(resource schema.GroupResource, listKind schema.GroupVersionKind, co
ret.SetGroupVersionKind(listKind)
return ret
},
ObjectNameFunc: func(obj runtime.Object) (string, error) {
accessor, err := meta.Accessor(obj)
if err != nil {
return "", err
}
return accessor.GetName(), nil
},
PredicateFunc: strategy.MatchCustomResourceDefinitionStorage,
QualifiedResource: resource,
......
......@@ -35,12 +35,9 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) *REST
strategy := NewStrategy(scheme)
store := &genericregistry.Store{
Copier: scheme,
NewFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinition{} },
NewListFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinitionList{} },
ObjectNameFunc: func(obj runtime.Object) (string, error) {
return obj.(*apiextensions.CustomResourceDefinition).Name, nil
},
Copier: scheme,
NewFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinition{} },
NewListFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinitionList{} },
PredicateFunc: MatchCustomResourceDefinition,
QualifiedResource: apiextensions.Resource("customresourcedefinitions"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment