From 07a883d8e62b7359c7b36313747ace45ed8a847b Mon Sep 17 00:00:00 2001 From: Hanna Lee Date: Tue, 20 Jul 2021 22:30:50 -0400 Subject: [PATCH] Remove //lint:ignore pragmas that aren't being used anymore --- cmd/kube-proxy/app/server.go | 3 +-- cmd/kube-scheduler/app/config/config.go | 3 +-- pkg/kubelet/dockershim/docker_container.go | 3 +-- pkg/kubelet/server/server.go | 3 +-- pkg/registry/core/namespace/storage/storage.go | 9 ++------- pkg/volume/util/fsquota/quota_linux.go | 5 ++--- .../garbagecollector/garbage_collector_test.go | 7 +++---- .../scheduler_perf/scheduler_perf_legacy_test.go | 3 +-- 8 files changed, 12 insertions(+), 24 deletions(-) diff --git a/cmd/kube-proxy/app/server.go b/cmd/kube-proxy/app/server.go index a0a920f3e0d..8241898fe66 100644 --- a/cmd/kube-proxy/app/server.go +++ b/cmd/kube-proxy/app/server.go @@ -623,8 +623,7 @@ func serveMetrics(bindAddress, proxyMode string, enableProfiling bool, errCh cha fmt.Fprintf(w, "%s", proxyMode) }) - //lint:ignore SA1019 See the Metrics Stability Migration KEP - //nolint:staticcheck + //nolint:staticcheck // SA1019 See the Metrics Stability Migration KEP proxyMux.Handle("/metrics", legacyregistry.Handler()) if enableProfiling { diff --git a/cmd/kube-scheduler/app/config/config.go b/cmd/kube-scheduler/app/config/config.go index 91fbf44164e..927a71b21b9 100644 --- a/cmd/kube-scheduler/app/config/config.go +++ b/cmd/kube-scheduler/app/config/config.go @@ -44,8 +44,7 @@ type Config struct { InformerFactory informers.SharedInformerFactory DynInformerFactory dynamicinformer.DynamicSharedInformerFactory - //lint:ignore SA1019 this deprecated field still needs to be used for now. It will be removed once the migration is done. - //nolint:staticcheck + //nolint:staticcheck // SA1019 this deprecated field still needs to be used for now. It will be removed once the migration is done. EventBroadcaster events.EventBroadcasterAdapter // LeaderElection is optional. diff --git a/pkg/kubelet/dockershim/docker_container.go b/pkg/kubelet/dockershim/docker_container.go index 7f5fb7c79c5..8cc686d9885 100644 --- a/pkg/kubelet/dockershim/docker_container.go +++ b/pkg/kubelet/dockershim/docker_container.go @@ -181,8 +181,7 @@ func (ds *dockerService) CreateContainer(_ context.Context, r *runtimeapi.Create } hc.Resources.Devices = devices - //lint:ignore SA1019 backwards compatibility - //nolint:staticcheck + //nolint:staticcheck // SA1019 backwards compatibility securityOpts, err := ds.getSecurityOpts(config.GetLinux().GetSecurityContext().GetSeccompProfilePath(), securityOptSeparator) if err != nil { return nil, fmt.Errorf("failed to generate security options for container %q: %v", config.Metadata.Name, err) diff --git a/pkg/kubelet/server/server.go b/pkg/kubelet/server/server.go index 9312dfd49c6..28dfc44977c 100644 --- a/pkg/kubelet/server/server.go +++ b/pkg/kubelet/server/server.go @@ -353,8 +353,7 @@ func (s *Server) InstallDefaultHandlers() { s.addMetricsBucketMatcher("metrics/cadvisor") s.addMetricsBucketMatcher("metrics/probes") s.addMetricsBucketMatcher("metrics/resource") - //lint:ignore SA1019 https://github.com/kubernetes/enhancements/issues/1206 - //nolint:staticcheck + //nolint:staticcheck // SA1019 https://github.com/kubernetes/enhancements/issues/1206 s.restfulCont.Handle(metricsPath, legacyregistry.Handler()) // cAdvisor metrics are exposed under the secured handler as well diff --git a/pkg/registry/core/namespace/storage/storage.go b/pkg/registry/core/namespace/storage/storage.go index 55bcbcc7dd1..a453d43f75e 100644 --- a/pkg/registry/core/namespace/storage/storage.go +++ b/pkg/registry/core/namespace/storage/storage.go @@ -253,11 +253,8 @@ func ShouldDeleteNamespaceDuringUpdate(ctx context.Context, key string, obj, exi } func shouldHaveOrphanFinalizer(options *metav1.DeleteOptions, haveOrphanFinalizer bool) bool { - //lint:ignore SA1019 backwards compatibility - //nolint:staticcheck + //nolint:staticcheck // SA1019 backwards compatibility if options.OrphanDependents != nil { - //lint:ignore SA1019 backwards compatibility - //nolint:staticcheck return *options.OrphanDependents } if options.PropagationPolicy != nil { @@ -267,10 +264,8 @@ func shouldHaveOrphanFinalizer(options *metav1.DeleteOptions, haveOrphanFinalize } func shouldHaveDeleteDependentsFinalizer(options *metav1.DeleteOptions, haveDeleteDependentsFinalizer bool) bool { - //lint:ignore SA1019 backwards compatibility - //nolint:staticcheck + //nolint:staticcheck // SA1019 backwards compatibility if options.OrphanDependents != nil { - //lint:ignore SA1019 backwards compatibility return *options.OrphanDependents == false } if options.PropagationPolicy != nil { diff --git a/pkg/volume/util/fsquota/quota_linux.go b/pkg/volume/util/fsquota/quota_linux.go index 68e9c9e1a8a..85784204aa1 100644 --- a/pkg/volume/util/fsquota/quota_linux.go +++ b/pkg/volume/util/fsquota/quota_linux.go @@ -304,8 +304,7 @@ func SupportsQuotas(m mount.Interface, path string) (bool, error) { // AssignQuota chooses the quota ID based on the pod UID and path. // If the pod UID is identical to another one known, it may (but presently // doesn't) choose the same quota ID as other volumes in the pod. -//lint:ignore SA4009 poduid is overwritten by design, see comment below -func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error { //nolint:staticcheck +func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error { //nolint:staticcheck // SA4009 poduid is overwritten by design, see comment below if bytes == nil { return fmt.Errorf("attempting to assign null quota to %s", path) } @@ -320,7 +319,7 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour // volumes in a pod, we can simply remove this line of code. // If and when we decide permanently that we're going to adopt // one quota per volume, we can rip all of the pod code out. - poduid = types.UID(uuid.NewUUID()) //nolint:staticcheck + poduid = types.UID(uuid.NewUUID()) //nolint:staticcheck // SA4009 poduid is overwritten by design, see comment above if pod, ok := dirPodMap[path]; ok && pod != poduid { return fmt.Errorf("requesting quota on existing directory %s but different pod %s %s", path, pod, poduid) } diff --git a/test/integration/garbagecollector/garbage_collector_test.go b/test/integration/garbagecollector/garbage_collector_test.go index 12f432d8846..1b633da03a2 100644 --- a/test/integration/garbagecollector/garbage_collector_test.go +++ b/test/integration/garbagecollector/garbage_collector_test.go @@ -598,13 +598,12 @@ func setupRCsPods(t *testing.T, gc *garbagecollector.GarbageCollector, clientSet } orphan := false switch { - //lint:file-ignore SA1019 Keep testing deprecated OrphanDependents option until it's being removed - case options.OrphanDependents == nil && options.PropagationPolicy == nil && len(initialFinalizers) == 0: //nolint:staticcheck + case options.OrphanDependents == nil && options.PropagationPolicy == nil && len(initialFinalizers) == 0: //nolint:staticcheck // SA1019 Keep testing deprecated OrphanDependents option until it's being removed // if there are no deletion options, the default policy for replication controllers is orphan orphan = true - case options.OrphanDependents != nil: //nolint:staticcheck + case options.OrphanDependents != nil: //nolint:staticcheck // SA1019 Keep testing deprecated OrphanDependents option until it's being removed // if the deletion options explicitly specify whether to orphan, that controls - orphan = *options.OrphanDependents //nolint:staticcheck + orphan = *options.OrphanDependents //nolint:staticcheck // SA1019 Keep testing deprecated OrphanDependents option until it's being removed case options.PropagationPolicy != nil: // if the deletion options explicitly specify whether to orphan, that controls orphan = *options.PropagationPolicy == metav1.DeletePropagationOrphan diff --git a/test/integration/scheduler_perf/scheduler_perf_legacy_test.go b/test/integration/scheduler_perf/scheduler_perf_legacy_test.go index 2ee024bb162..7a8a2810cce 100644 --- a/test/integration/scheduler_perf/scheduler_perf_legacy_test.go +++ b/test/integration/scheduler_perf/scheduler_perf_legacy_test.go @@ -439,8 +439,7 @@ func benchmarkScheduling(numExistingPods, minPods int, testPodStrategy testutils.TestPodCreateStrategy, b *testing.B) { if b.N < minPods { - //lint:ignore SA3001 Set a minimum for b.N to get more meaningful results - b.N = minPods //nolint:staticcheck + b.N = minPods //nolint:staticcheck // SA3001 Set a minimum for b.N to get more meaningful results } finalFunc, podInformer, clientset, _ := mustSetupScheduler(nil) defer finalFunc()