mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 21:36:24 +00:00
kube-apiserver/corerest: remove redundant interface
This commit is contained in:
parent
a864ce77b7
commit
19cb6d036a
@ -39,7 +39,7 @@ type REST struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewREST returns a RESTStorage object that will work against service accounts.
|
// 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{
|
store := &genericregistry.Store{
|
||||||
NewFunc: func() runtime.Object { return &api.ServiceAccount{} },
|
NewFunc: func() runtime.Object { return &api.ServiceAccount{} },
|
||||||
NewListFunc: func() runtime.Object { return &api.ServiceAccountList{} },
|
NewListFunc: func() runtime.Object { return &api.ServiceAccountList{} },
|
||||||
|
@ -50,9 +50,9 @@ func (r *TokenREST) Destroy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TokenREST struct {
|
type TokenREST struct {
|
||||||
svcaccts getter
|
svcaccts rest.Getter
|
||||||
pods getter
|
pods rest.Getter
|
||||||
secrets getter
|
secrets rest.Getter
|
||||||
issuer token.TokenGenerator
|
issuer token.TokenGenerator
|
||||||
auds authenticator.Audiences
|
auds authenticator.Audiences
|
||||||
audsSet sets.String
|
audsSet sets.String
|
||||||
@ -198,10 +198,6 @@ func (r *TokenREST) GroupVersionKind(schema.GroupVersion) schema.GroupVersionKin
|
|||||||
return gvk
|
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
|
// 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 {
|
func newContext(ctx context.Context, resource, name string, gvk schema.GroupVersionKind) context.Context {
|
||||||
oldInfo, found := genericapirequest.RequestInfoFrom(ctx)
|
oldInfo, found := genericapirequest.RequestInfoFrom(ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user