Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/kubeapiserver: fix staticcheck warning #85117

Merged
merged 1 commit into from Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion hack/.staticcheck_failures
Expand Up @@ -15,7 +15,6 @@ pkg/controller/podgc
pkg/controller/replicaset
pkg/controller/resourcequota
pkg/controller/statefulset
pkg/kubeapiserver/admission
pkg/kubelet/apis/podresources
pkg/kubelet/cm/devicemanager
pkg/kubelet/pluginmanager/operationexecutor
Expand Down
1 change: 0 additions & 1 deletion pkg/kubeapiserver/admission/BUILD
Expand Up @@ -15,7 +15,6 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/admission:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/initializer:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/authorization/authorizer:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/webhook:go_default_library",
"//staging/src/k8s.io/client-go/discovery/cached/memory:go_default_library",
Expand Down
11 changes: 3 additions & 8 deletions pkg/kubeapiserver/admission/initializer.go
Expand Up @@ -19,8 +19,6 @@ package admission
import (
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/authorization/authorizer"
"k8s.io/apiserver/pkg/util/webhook"
quota "k8s.io/kubernetes/pkg/quota/v1"
)

Expand All @@ -44,12 +42,9 @@ type WantsQuotaConfiguration interface {

// PluginInitializer is used for initialization of the Kubernetes specific admission plugins.
type PluginInitializer struct {
authorizer authorizer.Authorizer
cloudConfig []byte
restMapper meta.RESTMapper
quotaConfiguration quota.Configuration
serviceResolver webhook.ServiceResolver
authenticationInfoResolverWrapper webhook.AuthenticationInfoResolverWrapper
cloudConfig []byte
restMapper meta.RESTMapper
quotaConfiguration quota.Configuration
}

var _ admission.PluginInitializer = &PluginInitializer{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubeapiserver/options/authentication.go
Expand Up @@ -177,7 +177,7 @@ func (s *BuiltInAuthenticationOptions) Validate() []error {
}
if s.ServiceAccounts != nil && utilfeature.DefaultFeatureGate.Enabled(features.BoundServiceAccountTokenVolume) {
if !utilfeature.DefaultFeatureGate.Enabled(features.TokenRequest) || !utilfeature.DefaultFeatureGate.Enabled(features.TokenRequestProjection) {
allErrors = append(allErrors, errors.New("If the BoundServiceAccountTokenVolume feature is enabled,"+
allErrors = append(allErrors, errors.New("if the BoundServiceAccountTokenVolume feature is enabled,"+
" the TokenRequest and TokenRequestProjection features must also be enabled"))
}
if len(s.ServiceAccounts.Issuer) == 0 {
Expand Down