From fa665943ac0a40fe9eb93d7c3ccb3017d5e8d777 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Wed, 18 Dec 2019 22:01:58 +0200 Subject: [PATCH] nodeup/pkg/model - fix static check --- hack/.staticcheck_failures | 5 ----- k8s/crds/kops.k8s.io_clusters.yaml | 4 ++-- nodeup/pkg/model/convenience.go | 5 ----- nodeup/pkg/model/file_assets.go | 7 ------- nodeup/pkg/model/kubelet.go | 2 -- pkg/apis/kops/componentconfig.go | 2 +- pkg/apis/kops/v1alpha1/componentconfig.go | 2 +- pkg/apis/kops/v1alpha2/componentconfig.go | 2 +- 8 files changed, 5 insertions(+), 24 deletions(-) diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index 10da5d9694ec6..e2fdcd34a38cd 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -9,12 +9,7 @@ dnsprovider/pkg/dnsprovider/providers/google/clouddns/internal/stubs dnsprovider/pkg/dnsprovider/providers/openstack/designate node-authorizer/pkg/authorizers/aws node-authorizer/pkg/server -nodeup/pkg/model -pkg/apis/kops/v1alpha1 -pkg/apis/kops/v1alpha2 -pkg/apis/kops/validation pkg/instancegroups -pkg/model/components pkg/resources/ali pkg/resources/aws pkg/resources/digitalocean diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index ddaf6937b5287..c7d3bbb3b0492 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -774,8 +774,8 @@ spec: - use insecure-bind-address and bind-address' type: string admissionControl: - description: 'Deprecated: AdmissionControl is a list of admission - controllers to use' + description: 'AdmissionControl is a list of admission controllers + to use: Deprecated - use enable-admission-plugins instead' items: type: string type: array diff --git a/nodeup/pkg/model/convenience.go b/nodeup/pkg/model/convenience.go index a41217881a857..f626bec57d984 100644 --- a/nodeup/pkg/model/convenience.go +++ b/nodeup/pkg/model/convenience.go @@ -33,11 +33,6 @@ func s(v string) *string { return fi.String(v) } -// i64 is a helper that builds a *int64 from an int64 value -func i64(v int64) *int64 { - return fi.Int64(v) -} - // b returns a pointer to a boolean func b(v bool) *bool { return fi.Bool(v) diff --git a/nodeup/pkg/model/file_assets.go b/nodeup/pkg/model/file_assets.go index c69fe8e8279a3..8de51ded2c7e2 100644 --- a/nodeup/pkg/model/file_assets.go +++ b/nodeup/pkg/model/file_assets.go @@ -20,8 +20,6 @@ import ( "encoding/base64" "fmt" "path/filepath" - "strings" - "text/template" "k8s.io/kops/pkg/apis/kops" "k8s.io/kops/upup/pkg/fi" @@ -35,11 +33,6 @@ type FileAssetsBuilder struct { var _ fi.ModelBuilder = &FileAssetsBuilder{} -var templateFuncs = template.FuncMap{ - "split": strings.Split, - "join": strings.Join, -} - // Build is responsible for writing out the file assets from cluster and instanceGroup func (f *FileAssetsBuilder) Build(c *fi.ModelBuilderContext) error { // used to keep track of previous file, so a instanceGroup can override a cluster wide one diff --git a/nodeup/pkg/model/kubelet.go b/nodeup/pkg/model/kubelet.go index 278262b5c5047..9b39e16a10a24 100644 --- a/nodeup/pkg/model/kubelet.go +++ b/nodeup/pkg/model/kubelet.go @@ -566,8 +566,6 @@ func (b *KubeletBuilder) buildKubeletConfigSpec() (*kops.KubeletConfigSpec, erro // Enable scheduling since it can be controlled via taints. // For pre-1.6.0 clusters, this is handled by tainter.go c.RegisterSchedulable = fi.Bool(true) - } else { - // For 1.5 and earlier, protokube will taint the master } if c.VolumePluginDirectory == "" { diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 989d35d55ac93..33439b79ae582 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -266,7 +266,7 @@ type KubeAPIServerConfig struct { EnableBootstrapAuthToken *bool `json:"enableBootstrapTokenAuth,omitempty" flag:"enable-bootstrap-token-auth"` // EnableAggregatorRouting enables aggregator routing requests to endpoints IP rather than cluster IP EnableAggregatorRouting *bool `json:"enableAggregatorRouting,omitempty" flag:"enable-aggregator-routing"` - // Deprecated: AdmissionControl is a list of admission controllers to use + // AdmissionControl is a list of admission controllers to use: Deprecated - use enable-admission-plugins instead AdmissionControl []string `json:"admissionControl,omitempty" flag:"admission-control"` // AppendAdmissionPlugins appends list of enabled admission plugins AppendAdmissionPlugins []string `json:"appendAdmissionPlugins,omitempty"` diff --git a/pkg/apis/kops/v1alpha1/componentconfig.go b/pkg/apis/kops/v1alpha1/componentconfig.go index 44c6b150face7..dee18c73c94e1 100644 --- a/pkg/apis/kops/v1alpha1/componentconfig.go +++ b/pkg/apis/kops/v1alpha1/componentconfig.go @@ -266,7 +266,7 @@ type KubeAPIServerConfig struct { EnableBootstrapAuthToken *bool `json:"enableBootstrapTokenAuth,omitempty" flag:"enable-bootstrap-token-auth"` // EnableAggregatorRouting enables aggregator routing requests to endpoints IP rather than cluster IP EnableAggregatorRouting *bool `json:"enableAggregatorRouting,omitempty" flag:"enable-aggregator-routing"` - // Deprecated: AdmissionControl is a list of admission controllers to use + // AdmissionControl is a list of admission controllers to use: Deprecated - use enable-admission-plugins instead AdmissionControl []string `json:"admissionControl,omitempty" flag:"admission-control"` // AppendAdmissionPlugins appends list of enabled admission plugins AppendAdmissionPlugins []string `json:"appendAdmissionPlugins,omitempty"` diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index 707025cea4e01..92235b4d9085f 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -266,7 +266,7 @@ type KubeAPIServerConfig struct { EnableBootstrapAuthToken *bool `json:"enableBootstrapTokenAuth,omitempty" flag:"enable-bootstrap-token-auth"` // EnableAggregatorRouting enables aggregator routing requests to endpoints IP rather than cluster IP EnableAggregatorRouting *bool `json:"enableAggregatorRouting,omitempty" flag:"enable-aggregator-routing"` - // Deprecated: AdmissionControl is a list of admission controllers to use + // AdmissionControl is a list of admission controllers to use: Deprecated - use enable-admission-plugins instead AdmissionControl []string `json:"admissionControl,omitempty" flag:"admission-control"` // AppendAdmissionPlugins appends list of enabled admission plugins AppendAdmissionPlugins []string `json:"appendAdmissionPlugins,omitempty"`