kube-apiserver/corerest: remove redundant interface

This commit is contained in:
Dr. Stefan Schimanski 2023-07-03 12:30:43 +02:00
parent a864ce77b7
commit 19cb6d036a
No known key found for this signature in database
GPG Key ID: 4C68E0F19F95EC33
2 changed files with 4 additions and 8 deletions

View File

@ -39,7 +39,7 @@ type REST struct {
}
// NewREST returns a RESTStorage object that will work against service accounts.
func NewREST(optsGetter generic.RESTOptionsGetter, issuer token.TokenGenerator, auds authenticator.Audiences, max time.Duration, podStorage, secretStorage *genericregistry.Store, extendExpiration bool) (*REST, error) {
func NewREST(optsGetter generic.RESTOptionsGetter, issuer token.TokenGenerator, auds authenticator.Audiences, max time.Duration, podStorage, secretStorage rest.Getter, extendExpiration bool) (*REST, error) {
store := &genericregistry.Store{
NewFunc: func() runtime.Object { return &api.ServiceAccount{} },
NewListFunc: func() runtime.Object { return &api.ServiceAccountList{} },

View File

@ -50,9 +50,9 @@ func (r *TokenREST) Destroy() {
}
type TokenREST struct {
svcaccts getter
pods getter
secrets getter
svcaccts rest.Getter
pods rest.Getter
secrets rest.Getter
issuer token.TokenGenerator
auds authenticator.Audiences
audsSet sets.String
@ -198,10 +198,6 @@ func (r *TokenREST) GroupVersionKind(schema.GroupVersion) schema.GroupVersionKin
return gvk
}
type getter interface {
Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)
}
// newContext return a copy of ctx in which new RequestInfo is set
func newContext(ctx context.Context, resource, name string, gvk schema.GroupVersionKind) context.Context {
oldInfo, found := genericapirequest.RequestInfoFrom(ctx)