From afe23d07f96e389c170b8320ecb8bc77e09f5d9c Mon Sep 17 00:00:00 2001 From: Matt Boersma Date: Fri, 20 Dec 2024 11:33:38 -0700 Subject: [PATCH] Linter fixes --- api/v1beta1/azurecluster_default_test.go | 2 +- api/v1beta1/azurecluster_validation_test.go | 2 +- azure/services/aso/aso.go | 3 +-- azure/services/aso/aso_test.go | 5 ++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/api/v1beta1/azurecluster_default_test.go b/api/v1beta1/azurecluster_default_test.go index a9ec4e85dd7..057abfaa2a8 100644 --- a/api/v1beta1/azurecluster_default_test.go +++ b/api/v1beta1/azurecluster_default_test.go @@ -1602,7 +1602,7 @@ func TestAPIServerLBDefaults(t *testing.T) { tc := c t.Run(tc.name, func(t *testing.T) { if tc.featureGate != "" { - defer featuregatetesting.SetFeatureGateDuringTest(t, feature.Gates, tc.featureGate, true)() + featuregatetesting.SetFeatureGateDuringTest(t, feature.Gates, tc.featureGate, true) } tc.cluster.setAPIServerLBDefaults() if !reflect.DeepEqual(tc.cluster, tc.output) { diff --git a/api/v1beta1/azurecluster_validation_test.go b/api/v1beta1/azurecluster_validation_test.go index 2a83c976774..e3b9d8ed0b1 100644 --- a/api/v1beta1/azurecluster_validation_test.go +++ b/api/v1beta1/azurecluster_validation_test.go @@ -1280,7 +1280,7 @@ func TestValidateAPIServerLB(t *testing.T) { t.Run(test.name, func(t *testing.T) { g := NewWithT(t) if test.featureGate == feature.APIServerILB { - defer featuregatetesting.SetFeatureGateDuringTest(t, feature.Gates, test.featureGate, true)() + featuregatetesting.SetFeatureGateDuringTest(t, feature.Gates, test.featureGate, true) } err := validateAPIServerLB(&test.lb, &test.old, test.cpCIDRS, field.NewPath("apiServerLB")) if test.wantErr { diff --git a/azure/services/aso/aso.go b/azure/services/aso/aso.go index 56cb356c2e2..36e3b4ad322 100644 --- a/azure/services/aso/aso.go +++ b/azure/services/aso/aso.go @@ -378,8 +378,7 @@ func isOwnedBy(resource client.Object, owner client.Object, scheme *runtime.Sche } func hasLegacyOwnedByLabel(labels map[string]string, clusterName string) bool { - //nolint:staticcheck // Referencing this deprecated value is required for backwards compatibility. - return labels[infrav1.OwnedByClusterLabelKey] == clusterName + return labels[infrav1.OwnedByClusterLabelKey] == clusterName //nolint:staticcheck // Referencing this deprecated value is required for backwards compatibility. } // PauseResource pauses an ASO resource by updating its `reconcile-policy` to `skip`. diff --git a/azure/services/aso/aso_test.go b/azure/services/aso/aso_test.go index 5f6e56f44b4..d519396671b 100644 --- a/azure/services/aso/aso_test.go +++ b/azure/services/aso/aso_test.go @@ -565,9 +565,8 @@ func TestCreateOrUpdateResource(t *testing.T) { Name: "name", Namespace: "namespace", Labels: map[string]string{ - clusterv1.ClusterNameLabel: clusterName, - //nolint:staticcheck // Referencing this deprecated value is required for backwards compatibility. - infrav1.OwnedByClusterLabelKey: clusterName, + clusterv1.ClusterNameLabel: clusterName, + infrav1.OwnedByClusterLabelKey: clusterName, //nolint:staticcheck // Referencing this deprecated value is required for backwards compatibility. }, Annotations: map[string]string{ asoannotations.ReconcilePolicy: string(asoannotations.ReconcilePolicySkip),