mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
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: Monis Khan <mkhan@redhat.com> **Release note**: ``` NONE ```
This commit is contained in:
commit
151846db80
@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
package customresource
|
package customresource
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
@ -41,13 +40,6 @@ func NewREST(resource schema.GroupResource, listKind schema.GroupVersionKind, co
|
|||||||
ret.SetGroupVersionKind(listKind)
|
ret.SetGroupVersionKind(listKind)
|
||||||
return ret
|
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,
|
PredicateFunc: strategy.MatchCustomResourceDefinitionStorage,
|
||||||
QualifiedResource: resource,
|
QualifiedResource: resource,
|
||||||
|
|
||||||
|
@ -38,9 +38,6 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) *REST
|
|||||||
Copier: scheme,
|
Copier: scheme,
|
||||||
NewFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinition{} },
|
NewFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinition{} },
|
||||||
NewListFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinitionList{} },
|
NewListFunc: func() runtime.Object { return &apiextensions.CustomResourceDefinitionList{} },
|
||||||
ObjectNameFunc: func(obj runtime.Object) (string, error) {
|
|
||||||
return obj.(*apiextensions.CustomResourceDefinition).Name, nil
|
|
||||||
},
|
|
||||||
PredicateFunc: MatchCustomResourceDefinition,
|
PredicateFunc: MatchCustomResourceDefinition,
|
||||||
QualifiedResource: apiextensions.Resource("customresourcedefinitions"),
|
QualifiedResource: apiextensions.Resource("customresourcedefinitions"),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user