From c8fde197f5ef7f232a790798e98063bcebd9635f Mon Sep 17 00:00:00 2001 From: Hanna Lee Date: Sun, 18 Jul 2021 14:48:32 -0400 Subject: [PATCH] Add more //nolint:staticcheck for failures caught in PR tests --- pkg/volume/util/fsquota/quota_linux.go | 4 ++-- test/integration/garbagecollector/garbage_collector_test.go | 6 +++--- .../scheduler_perf/scheduler_perf_legacy_test.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/volume/util/fsquota/quota_linux.go b/pkg/volume/util/fsquota/quota_linux.go index 2da7d263997..68e9c9e1a8a 100644 --- a/pkg/volume/util/fsquota/quota_linux.go +++ b/pkg/volume/util/fsquota/quota_linux.go @@ -305,7 +305,7 @@ func SupportsQuotas(m mount.Interface, path string) (bool, error) { // 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 { +func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error { //nolint:staticcheck if bytes == nil { return fmt.Errorf("attempting to assign null quota to %s", path) } @@ -320,7 +320,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()) + poduid = types.UID(uuid.NewUUID()) //nolint:staticcheck 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 ed0385aca5d..12f432d8846 100644 --- a/test/integration/garbagecollector/garbage_collector_test.go +++ b/test/integration/garbagecollector/garbage_collector_test.go @@ -599,12 +599,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: + case options.OrphanDependents == nil && options.PropagationPolicy == nil && len(initialFinalizers) == 0: //nolint:staticcheck // if there are no deletion options, the default policy for replication controllers is orphan orphan = true - case options.OrphanDependents != nil: + case options.OrphanDependents != nil: //nolint:staticcheck // if the deletion options explicitly specify whether to orphan, that controls - orphan = *options.OrphanDependents + orphan = *options.OrphanDependents //nolint:staticcheck 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 42267238c35..2ee024bb162 100644 --- a/test/integration/scheduler_perf/scheduler_perf_legacy_test.go +++ b/test/integration/scheduler_perf/scheduler_perf_legacy_test.go @@ -440,7 +440,7 @@ func benchmarkScheduling(numExistingPods, minPods int, b *testing.B) { if b.N < minPods { //lint:ignore SA3001 Set a minimum for b.N to get more meaningful results - b.N = minPods + b.N = minPods //nolint:staticcheck } finalFunc, podInformer, clientset, _ := mustSetupScheduler(nil) defer finalFunc()