diff --git a/pkg/registry/apiserverinternal/storageversion/storage/storage.go b/pkg/registry/apiserverinternal/storageversion/storage/storage.go index 92ede95afc7..86ee40d8c95 100644 --- a/pkg/registry/apiserverinternal/storageversion/storage/storage.go +++ b/pkg/registry/apiserverinternal/storageversion/storage/storage.go @@ -100,9 +100,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/apps/daemonset/storage/storage.go b/pkg/registry/apps/daemonset/storage/storage.go index 5f2246f0e95..16e91b3e873 100644 --- a/pkg/registry/apps/daemonset/storage/storage.go +++ b/pkg/registry/apps/daemonset/storage/storage.go @@ -115,9 +115,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/apps/deployment/storage/storage.go b/pkg/registry/apps/deployment/storage/storage.go index d5f2ce5297a..3d49c944e67 100644 --- a/pkg/registry/apps/deployment/storage/storage.go +++ b/pkg/registry/apps/deployment/storage/storage.go @@ -168,12 +168,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - // RollbackREST implements the REST endpoint for initiating the rollback of a deployment type RollbackREST struct { store *genericregistry.Store @@ -204,12 +198,6 @@ func (r *RollbackREST) Destroy() { // we don't destroy it here explicitly. } -var _ rest.SingularNameProvider = &RollbackREST{} - -func (r *RollbackREST) GetSingularName() string { - return r.store.GetSingularName() + "/rollback" -} - var _ = rest.NamedCreater(&RollbackREST{}) // Create runs rollback for deployment @@ -354,12 +342,6 @@ func (r *ScaleREST) ConvertToTable(ctx context.Context, object runtime.Object, t return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &ScaleREST{} - -func (r *ScaleREST) GetSingularName() string { - return r.store.GetSingularName() + "/scale" -} - func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc { return func(ctx context.Context, obj runtime.Object) error { scale, err := scaleFromDeployment(obj.(*apps.Deployment)) diff --git a/pkg/registry/apps/replicaset/storage/storage.go b/pkg/registry/apps/replicaset/storage/storage.go index 806c362676e..28131b416e8 100644 --- a/pkg/registry/apps/replicaset/storage/storage.go +++ b/pkg/registry/apps/replicaset/storage/storage.go @@ -164,12 +164,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - // ScaleREST implements a Scale for ReplicaSet. type ScaleREST struct { store *genericregistry.Store @@ -244,12 +238,6 @@ func (r *ScaleREST) ConvertToTable(ctx context.Context, object runtime.Object, t return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &ScaleREST{} - -func (r *ScaleREST) GetSingularName() string { - return r.store.GetSingularName() + "/scale" -} - func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc { return func(ctx context.Context, obj runtime.Object) error { scale, err := scaleFromReplicaSet(obj.(*apps.ReplicaSet)) diff --git a/pkg/registry/apps/statefulset/storage/storage.go b/pkg/registry/apps/statefulset/storage/storage.go index ef9f8984e5d..73bd391b259 100644 --- a/pkg/registry/apps/statefulset/storage/storage.go +++ b/pkg/registry/apps/statefulset/storage/storage.go @@ -152,12 +152,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - // Implement ShortNamesProvider var _ rest.ShortNamesProvider = &REST{} @@ -238,12 +232,6 @@ func (r *ScaleREST) ConvertToTable(ctx context.Context, object runtime.Object, t return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &ScaleREST{} - -func (r *ScaleREST) GetSingularName() string { - return r.store.GetSingularName() + "/scale" -} - func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc { return func(ctx context.Context, obj runtime.Object) error { scale, err := scaleFromStatefulSet(obj.(*apps.StatefulSet)) diff --git a/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage.go b/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage.go index 4822f1bc540..bedd6814756 100644 --- a/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage.go +++ b/pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage.go @@ -115,9 +115,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/batch/cronjob/storage/storage.go b/pkg/registry/batch/cronjob/storage/storage.go index 94b5b58f7db..a963d140517 100644 --- a/pkg/registry/batch/cronjob/storage/storage.go +++ b/pkg/registry/batch/cronjob/storage/storage.go @@ -113,9 +113,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/batch/job/storage/storage.go b/pkg/registry/batch/job/storage/storage.go index 2959a1ca042..9ca9d5f974a 100644 --- a/pkg/registry/batch/job/storage/storage.go +++ b/pkg/registry/batch/job/storage/storage.go @@ -156,9 +156,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/certificates/certificates/storage/storage.go b/pkg/registry/certificates/certificates/storage/storage.go index 045157653c0..d45391924f2 100644 --- a/pkg/registry/certificates/certificates/storage/storage.go +++ b/pkg/registry/certificates/certificates/storage/storage.go @@ -117,12 +117,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - var _ = rest.Patcher(&StatusREST{}) // ApprovalREST implements the REST endpoint for changing the approval state of a CSR. @@ -158,10 +152,4 @@ func (r *ApprovalREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set return r.store.GetResetFields() } -var _ rest.SingularNameProvider = &ApprovalREST{} - -func (r *ApprovalREST) GetSingularName() string { - return r.store.GetSingularName() + "/approval" -} - var _ = rest.Patcher(&ApprovalREST{}) diff --git a/pkg/registry/core/endpoint/storage/storage.go b/pkg/registry/core/endpoint/storage/storage.go index c82deb687d1..a3c31d3eb36 100644 --- a/pkg/registry/core/endpoint/storage/storage.go +++ b/pkg/registry/core/endpoint/storage/storage.go @@ -39,7 +39,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, error) { NewFunc: func() runtime.Object { return &api.Endpoints{} }, NewListFunc: func() runtime.Object { return &api.EndpointsList{} }, DefaultQualifiedResource: api.Resource("endpoints"), - SingularQualifiedResource: api.Resource("endpoint"), + SingularQualifiedResource: api.Resource("endpoints"), CreateStrategy: endpoint.Strategy, UpdateStrategy: endpoint.Strategy, diff --git a/pkg/registry/core/namespace/storage/storage.go b/pkg/registry/core/namespace/storage/storage.go index e9a37779f0d..e88fad7fa8a 100644 --- a/pkg/registry/core/namespace/storage/storage.go +++ b/pkg/registry/core/namespace/storage/storage.go @@ -339,12 +339,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - func (r *FinalizeREST) New() runtime.Object { return r.store.New() } @@ -366,9 +360,3 @@ func (r *FinalizeREST) Update(ctx context.Context, name string, objInfo rest.Upd func (r *FinalizeREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { return r.store.GetResetFields() } - -var _ rest.SingularNameProvider = &FinalizeREST{} - -func (r *FinalizeREST) GetSingularName() string { - return r.store.GetSingularName() + "/finalize" -} diff --git a/pkg/registry/core/node/rest/proxy.go b/pkg/registry/core/node/rest/proxy.go index d3c1c7122f2..40e6431b40b 100644 --- a/pkg/registry/core/node/rest/proxy.go +++ b/pkg/registry/core/node/rest/proxy.go @@ -66,12 +66,6 @@ func (r *ProxyREST) NewConnectOptions() (runtime.Object, bool, string) { return &api.NodeProxyOptions{}, true, "path" } -var _ rest.SingularNameProvider = &ProxyREST{} - -func (r *ProxyREST) GetSingularName() string { - return r.Store.GetSingularName() + "/proxy" -} - // Connect returns a handler for the node proxy func (r *ProxyREST) Connect(ctx context.Context, id string, opts runtime.Object, responder rest.Responder) (http.Handler, error) { proxyOpts, ok := opts.(*api.NodeProxyOptions) diff --git a/pkg/registry/core/node/storage/storage.go b/pkg/registry/core/node/storage/storage.go index 54c6b400dc0..5b6ce5eb0af 100644 --- a/pkg/registry/core/node/storage/storage.go +++ b/pkg/registry/core/node/storage/storage.go @@ -93,12 +93,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - // NewStorage returns a NodeStorage object that will work against nodes. func NewStorage(optsGetter generic.RESTOptionsGetter, kubeletClientConfig client.KubeletClientConfig, proxyTransport http.RoundTripper) (*NodeStorage, error) { store := &genericregistry.Store{ diff --git a/pkg/registry/core/persistentvolume/storage/storage.go b/pkg/registry/core/persistentvolume/storage/storage.go index 63014aa2667..41422229bcf 100644 --- a/pkg/registry/core/persistentvolume/storage/storage.go +++ b/pkg/registry/core/persistentvolume/storage/storage.go @@ -110,9 +110,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/core/persistentvolumeclaim/storage/storage.go b/pkg/registry/core/persistentvolumeclaim/storage/storage.go index 611fbc013ee..4ba7b954242 100644 --- a/pkg/registry/core/persistentvolumeclaim/storage/storage.go +++ b/pkg/registry/core/persistentvolumeclaim/storage/storage.go @@ -154,9 +154,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/core/pod/rest/log.go b/pkg/registry/core/pod/rest/log.go index b3180f334ee..e6b02069b28 100644 --- a/pkg/registry/core/pod/rest/log.go +++ b/pkg/registry/core/pod/rest/log.go @@ -133,9 +133,3 @@ func (r *LogREST) OverrideMetricsVerb(oldVerb string) (newVerb string) { return } - -var _ rest.SingularNameProvider = &LogREST{} - -func (r *LogREST) GetSingularName() string { - return r.Store.GetSingularName() + "/log" -} diff --git a/pkg/registry/core/pod/rest/subresources.go b/pkg/registry/core/pod/rest/subresources.go index 6972a8fb80e..76e0cdd4ffb 100644 --- a/pkg/registry/core/pod/rest/subresources.go +++ b/pkg/registry/core/pod/rest/subresources.go @@ -80,12 +80,6 @@ func (r *ProxyREST) Connect(ctx context.Context, id string, opts runtime.Object, return newThrottledUpgradeAwareProxyHandler(location, transport, true, false, responder), nil } -var _ rest.SingularNameProvider = &ProxyREST{} - -func (r *ProxyREST) GetSingularName() string { - return r.Store.GetSingularName() + "/proxy" -} - // Support both GET and POST methods. We must support GET for browsers that want to use WebSockets. var upgradeableMethods = []string{"GET", "POST"} @@ -132,12 +126,6 @@ func (r *AttachREST) ConnectMethods() []string { return upgradeableMethods } -var _ rest.SingularNameProvider = &AttachREST{} - -func (r *AttachREST) GetSingularName() string { - return r.Store.GetSingularName() + "/attach" -} - // ExecREST implements the exec subresource for a Pod type ExecREST struct { Store *genericregistry.Store @@ -181,12 +169,6 @@ func (r *ExecREST) ConnectMethods() []string { return upgradeableMethods } -var _ rest.SingularNameProvider = &ExecREST{} - -func (r *ExecREST) GetSingularName() string { - return r.Store.GetSingularName() + "/exec" -} - // PortForwardREST implements the portforward subresource for a Pod type PortForwardREST struct { Store *genericregistry.Store @@ -231,12 +213,6 @@ func (r *PortForwardREST) Connect(ctx context.Context, name string, opts runtime return newThrottledUpgradeAwareProxyHandler(location, transport, false, true, responder), nil } -var _ rest.SingularNameProvider = &PortForwardREST{} - -func (r *PortForwardREST) GetSingularName() string { - return r.Store.GetSingularName() + "/portforward" -} - func newThrottledUpgradeAwareProxyHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder rest.Responder) *proxy.UpgradeAwareHandler { handler := proxy.NewUpgradeAwareHandler(location, transport, wrapTransport, upgradeRequired, proxy.NewErrorResponder(responder)) handler.MaxBytesPerSec = capabilities.Get().PerConnectionBandwidthLimitBytesPerSec diff --git a/pkg/registry/core/pod/storage/eviction.go b/pkg/registry/core/pod/storage/eviction.go index 70876530297..ee8182c4135 100644 --- a/pkg/registry/core/pod/storage/eviction.go +++ b/pkg/registry/core/pod/storage/eviction.go @@ -103,12 +103,6 @@ func (r *EvictionREST) Destroy() { // we don't destroy it here explicitly. } -var _ rest.SingularNameProvider = &EvictionREST{} - -func (r *EvictionREST) GetSingularName() string { - return "pod/eviction" -} - // Propagate dry-run takes the dry-run option from the request and pushes it into the eviction object. // It returns an error if they have non-matching dry-run options. func propagateDryRun(eviction *policy.Eviction, options *metav1.CreateOptions) (*metav1.DeleteOptions, error) { diff --git a/pkg/registry/core/pod/storage/storage.go b/pkg/registry/core/pod/storage/storage.go index 6add1f57471..4a10f4fd35e 100644 --- a/pkg/registry/core/pod/storage/storage.go +++ b/pkg/registry/core/pod/storage/storage.go @@ -164,12 +164,6 @@ func (r *BindingREST) Destroy() { // we don't destroy it here explicitly. } -var _ rest.SingularNameProvider = &BindingREST{} - -func (r *BindingREST) GetSingularName() string { - return r.store.GetSingularName() + "/binding" -} - var _ = rest.NamedCreater(&BindingREST{}) // Create ensures a pod is bound to a specific host. @@ -338,12 +332,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - // EphemeralContainersREST implements the REST endpoint for adding EphemeralContainers type EphemeralContainersREST struct { store *genericregistry.Store @@ -373,9 +361,3 @@ func (r *EphemeralContainersREST) Update(ctx context.Context, name string, objIn // subresources should never allow create on update. return r.store.Update(ctx, name, objInfo, createValidation, updateValidation, false, options) } - -var _ rest.SingularNameProvider = &EphemeralContainersREST{} - -func (r *EphemeralContainersREST) GetSingularName() string { - return r.store.GetSingularName() + "/ephemeralcontainers" -} diff --git a/pkg/registry/core/replicationcontroller/storage/storage.go b/pkg/registry/core/replicationcontroller/storage/storage.go index d8d6fcf124b..edc5c7c8dd0 100644 --- a/pkg/registry/core/replicationcontroller/storage/storage.go +++ b/pkg/registry/core/replicationcontroller/storage/storage.go @@ -159,12 +159,6 @@ func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - type ScaleREST struct { store *genericregistry.Store } @@ -223,12 +217,6 @@ func (r *ScaleREST) ConvertToTable(ctx context.Context, object runtime.Object, t return r.store.ConvertToTable(ctx, object, tableOptions) } -var _ rest.SingularNameProvider = &ScaleREST{} - -func (r *ScaleREST) GetSingularName() string { - return r.store.GetSingularName() + "/scale" -} - func toScaleCreateValidation(f rest.ValidateObjectFunc) rest.ValidateObjectFunc { return func(ctx context.Context, obj runtime.Object) error { return f(ctx, scaleFromRC(obj.(*api.ReplicationController))) diff --git a/pkg/registry/core/resourcequota/storage/storage.go b/pkg/registry/core/resourcequota/storage/storage.go index 214ccdddecc..c67038f1df4 100644 --- a/pkg/registry/core/resourcequota/storage/storage.go +++ b/pkg/registry/core/resourcequota/storage/storage.go @@ -109,9 +109,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/core/service/proxy.go b/pkg/registry/core/service/proxy.go index 92cf50ef199..f0eb9d0788a 100644 --- a/pkg/registry/core/service/proxy.go +++ b/pkg/registry/core/service/proxy.go @@ -77,12 +77,6 @@ func (r *ProxyREST) Connect(ctx context.Context, id string, opts runtime.Object, return newThrottledUpgradeAwareProxyHandler(location, transport, true, false, responder), nil } -var _ rest.SingularNameProvider = &ProxyREST{} - -func (r *ProxyREST) GetSingularName() string { - return "service/proxy" -} - func newThrottledUpgradeAwareProxyHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder rest.Responder) *proxy.UpgradeAwareHandler { handler := proxy.NewUpgradeAwareHandler(location, transport, wrapTransport, upgradeRequired, proxy.NewErrorResponder(responder)) handler.MaxBytesPerSec = capabilities.Get().PerConnectionBandwidthLimitBytesPerSec diff --git a/pkg/registry/core/service/storage/storage.go b/pkg/registry/core/service/storage/storage.go index 179614ab062..4ff923f5e4f 100644 --- a/pkg/registry/core/service/storage/storage.go +++ b/pkg/registry/core/service/storage/storage.go @@ -196,12 +196,6 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { return r.store.GetResetFields() } -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} - // We have a lot of functions that take a pair of "before" and "after" or // "oldSvc" and "newSvc" args. Convention across the codebase is to pass them // as (new, old), but it's easy to screw up when they are the same type. diff --git a/pkg/registry/core/serviceaccount/storage/token.go b/pkg/registry/core/serviceaccount/storage/token.go index 1a78da264f2..6f840e53154 100644 --- a/pkg/registry/core/serviceaccount/storage/token.go +++ b/pkg/registry/core/serviceaccount/storage/token.go @@ -49,12 +49,6 @@ func (r *TokenREST) Destroy() { // here explicitly. } -var _ rest.SingularNameProvider = &TokenREST{} - -func (r *TokenREST) GetSingularName() string { - return "serviceaccount/token" -} - type TokenREST struct { svcaccts getter pods getter diff --git a/pkg/registry/flowcontrol/flowschema/storage/storage.go b/pkg/registry/flowcontrol/flowschema/storage/storage.go index 73d662e9d33..5a1146201a6 100644 --- a/pkg/registry/flowcontrol/flowschema/storage/storage.go +++ b/pkg/registry/flowcontrol/flowschema/storage/storage.go @@ -108,9 +108,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go b/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go index e64e29ebcb8..2149b5906f4 100644 --- a/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go +++ b/pkg/registry/flowcontrol/prioritylevelconfiguration/storage/storage.go @@ -108,9 +108,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/networking/ingress/storage/storage.go b/pkg/registry/networking/ingress/storage/storage.go index 28789e148bf..9018055af76 100644 --- a/pkg/registry/networking/ingress/storage/storage.go +++ b/pkg/registry/networking/ingress/storage/storage.go @@ -107,9 +107,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/networking/networkpolicy/storage/storage.go b/pkg/registry/networking/networkpolicy/storage/storage.go index 3cfbda1e905..0445c98a4c2 100644 --- a/pkg/registry/networking/networkpolicy/storage/storage.go +++ b/pkg/registry/networking/networkpolicy/storage/storage.go @@ -105,9 +105,3 @@ func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.Updat func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { return r.store.GetResetFields() } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/policy/poddisruptionbudget/storage/storage.go b/pkg/registry/policy/poddisruptionbudget/storage/storage.go index bf1b93f5d20..0c7b1ba1f7b 100644 --- a/pkg/registry/policy/poddisruptionbudget/storage/storage.go +++ b/pkg/registry/policy/poddisruptionbudget/storage/storage.go @@ -104,9 +104,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/pkg/registry/storage/volumeattachment/storage/storage.go b/pkg/registry/storage/volumeattachment/storage/storage.go index 7265b8d9411..1d213730a74 100644 --- a/pkg/registry/storage/volumeattachment/storage/storage.go +++ b/pkg/registry/storage/volumeattachment/storage/storage.go @@ -112,9 +112,3 @@ func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { return r.store.ConvertToTable(ctx, object, tableOptions) } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go index f6be9d84c0e..6300a08ce43 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go +++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go @@ -218,9 +218,3 @@ func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.Updat func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { return r.store.GetResetFields() } - -var _ rest.SingularNameProvider = &StatusREST{} - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -} diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go b/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go index 63d21706209..2c4d7b95793 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go @@ -1080,11 +1080,13 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag if categoriesProvider, ok := storage.(rest.CategoriesProvider); ok { apiResource.Categories = categoriesProvider.Categories() } - singularNameProvider, ok := storage.(rest.SingularNameProvider) - if !ok { - return nil, nil, fmt.Errorf("resource %s must implement SingularNameProvider", resource) + if !isSubresource { + singularNameProvider, ok := storage.(rest.SingularNameProvider) + if !ok { + return nil, nil, fmt.Errorf("resource %s must implement SingularNameProvider", resource) + } + apiResource.SingularName = singularNameProvider.GetSingularName() } - apiResource.SingularName = singularNameProvider.GetSingularName() if gvkProvider, ok := storage.(rest.GroupVersionKindProvider); ok { gvk := gvkProvider.GroupVersionKind(a.group.GroupVersion) diff --git a/staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go b/staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go index 2dfd18ccf07..42dddcd8315 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go @@ -170,7 +170,3 @@ func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.Updat func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { return r.store.GetResetFields() } - -func (r *StatusREST) GetSingularName() string { - return r.store.GetSingularName() + "/status" -}