Skip to content

Commit

Permalink
Put nolint directives on things we cannot handle otherwise
Browse files Browse the repository at this point in the history
Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
  • Loading branch information
embik committed Jul 15, 2024
1 parent 38d1fa5 commit 3224539
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
}
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/topology/partitionset/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/server/apiextensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 3224539

Please sign in to comment.