From 3224539af2cdfe8f923326244b5babe036232573 Mon Sep 17 00:00:00 2001 From: Marvin Beckers Date: Mon, 15 Jul 2024 14:24:23 +0200 Subject: [PATCH] Put nolint directives on things we cannot handle otherwise Signed-off-by: Marvin Beckers --- .../garbagecollector/garbagecollector_controller.go | 2 ++ pkg/reconciler/topology/partitionset/resources.go | 4 ++-- pkg/server/apiextensions_test.go | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/reconciler/garbagecollector/garbagecollector_controller.go b/pkg/reconciler/garbagecollector/garbagecollector_controller.go index 08b045161063..252ee41158c2 100644 --- a/pkg/reconciler/garbagecollector/garbagecollector_controller.go +++ b/pkg/reconciler/garbagecollector/garbagecollector_controller.go @@ -264,6 +264,7 @@ func (c *Controller) startGarbageCollectorForLogicalCluster(ctx context.Context, clusterName: clusterName, queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "quota-"+clusterName.String()), work: func(ctx context.Context) { + //nolint:errcheck garbageCollector.ResyncMonitors(ctx, c.dynamicDiscoverySharedInformerFactory) }, } @@ -286,6 +287,7 @@ func (c *Controller) startGarbageCollectorForLogicalCluster(ctx context.Context, // Do this in a goroutine to avoid holding up a worker in the event ResyncMonitors stalls for whatever reason go func() { // Make sure the GC monitors are synced at least once + //nolint:errcheck garbageCollector.ResyncMonitors(ctx, c.dynamicDiscoverySharedInformerFactory) go garbageCollector.Run(ctx, c.workersPerLogicalCluster) diff --git a/pkg/reconciler/topology/partitionset/resources.go b/pkg/reconciler/topology/partitionset/resources.go index c3779a028647..d82849ebfc7a 100644 --- a/pkg/reconciler/topology/partitionset/resources.go +++ b/pkg/reconciler/topology/partitionset/resources.go @@ -51,11 +51,11 @@ func generatePartitionName(name string, matchLabels map[string]string, dimension for _, label := range labels { name = name + "-" + strings.ToLower(matchLabels[label]) } - name = name[:min(validation.DNS1123SubdomainMaxLength-1, len(name))] + name = name[:minimum(validation.DNS1123SubdomainMaxLength-1, len(name))] return name } -func min(a, b int) int { +func minimum(a, b int) int { if a < b { return a } diff --git a/pkg/server/apiextensions_test.go b/pkg/server/apiextensions_test.go index a7f83e109a6f..51a4ab8924aa 100644 --- a/pkg/server/apiextensions_test.go +++ b/pkg/server/apiextensions_test.go @@ -108,10 +108,12 @@ func TestDecorateCRDWithBinding(t *testing.T) { for _, expCondition := range tt.expectedConditions { cond := apiextensionshelpers.FindCRDCondition(newCrd, expCondition.Type) + //nolint:staticcheck if cond == nil { t.Fatalf("Missing status condition %v", expCondition.Type) } + //nolint:staticcheck if cond.Status != expCondition.Status { t.Errorf("expect condition status %q, got %q for type %s", expCondition.Status, cond.Status, cond.Type) }