From 0fe9357c313cdfb1306be1612387bc6214ba3770 Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Fri, 4 Apr 2025 12:29:10 -0700 Subject: [PATCH] chore: remove revive lint ignore statements Signed-off-by: Jack Francis --- azure/services/availabilitysets/client.go | 4 ++-- azure/services/networkinterfaces/client.go | 14 +++++++------- azure/services/roleassignments/client.go | 2 +- test/e2e/cni.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/azure/services/availabilitysets/client.go b/azure/services/availabilitysets/client.go index 859789d3f37..6452cc7fb1e 100644 --- a/azure/services/availabilitysets/client.go +++ b/azure/services/availabilitysets/client.go @@ -60,7 +60,7 @@ func (ac *AzureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) ( // CreateOrUpdateAsync creates or updates an availability set asynchronously. // It sends a PUT request to Azure and if accepted without error, the func will return a Poller which can be used to track the ongoing // progress of the operation. -func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, _resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armcompute.AvailabilitySetsClientCreateOrUpdateResponse], err error) { //nolint:revive // keeping _resumeToken for understanding purposes +func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, _ string, parameters interface{}) (result interface{}, poller *runtime.Poller[armcompute.AvailabilitySetsClientCreateOrUpdateResponse], err error) { // ignore the resumeToken (3rd arg) as availability sets do not support polling in the same way as other resources ctx, _, done := tele.StartSpanWithLogger(ctx, "availabilitySets.AzureClient.CreateOrUpdateAsync") defer done() @@ -82,7 +82,7 @@ func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.Resou // DeleteAsync deletes a availability set asynchronously. DeleteAsync sends a DELETE // request to Azure and if accepted without error, the func will return a Poller which can be used to track the ongoing // progress of the operation. -func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, _resumeToken string) (poller *runtime.Poller[armcompute.AvailabilitySetsClientDeleteResponse], err error) { //nolint:revive // keeping _resumeToken for understanding purposes +func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, _ string) (poller *runtime.Poller[armcompute.AvailabilitySetsClientDeleteResponse], err error) { // ignore the resumeToken (3rd arg) as availability sets do not support polling in the same way as other resources ctx, _, done := tele.StartSpanWithLogger(ctx, "availabilitysets.AzureClient.DeleteAsync") defer done() diff --git a/azure/services/networkinterfaces/client.go b/azure/services/networkinterfaces/client.go index 62fefd8d304..99835373c7c 100644 --- a/azure/services/networkinterfaces/client.go +++ b/azure/services/networkinterfaces/client.go @@ -29,14 +29,14 @@ import ( "sigs.k8s.io/cluster-api-provider-azure/util/tele" ) -// azureClient contains the Azure go-sdk Client. -type azureClient struct { +// AzureClient contains the Azure go-sdk Client. +type AzureClient struct { interfaces *armnetwork.InterfacesClient apiCallTimeout time.Duration } // NewClient creates a new network interfaces client from an authorizer. -func NewClient(auth azure.Authorizer, apiCallTimeout time.Duration) (*azureClient, error) { //nolint:revive // leave it as is +func NewClient(auth azure.Authorizer, apiCallTimeout time.Duration) (*AzureClient, error) { opts, err := azure.ARMClientOptions(auth.CloudEnvironment()) if err != nil { return nil, errors.Wrap(err, "failed to create networkinterfaces client options") @@ -45,11 +45,11 @@ func NewClient(auth azure.Authorizer, apiCallTimeout time.Duration) (*azureClien if err != nil { return nil, errors.Wrap(err, "failed to create armnetwork client factory") } - return &azureClient{factory.NewInterfacesClient(), apiCallTimeout}, nil + return &AzureClient{factory.NewInterfacesClient(), apiCallTimeout}, nil } // Get gets the specified network interface. -func (ac *azureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) (result interface{}, err error) { +func (ac *AzureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) (result interface{}, err error) { ctx, _, done := tele.StartSpanWithLogger(ctx, "networkinterfaces.AzureClient.Get") defer done() @@ -63,7 +63,7 @@ func (ac *azureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) ( // CreateOrUpdateAsync creates or updates a network interface asynchronously. // It sends a PUT request to Azure and if accepted without error, the func will return a poller which can be used to track the ongoing // progress of the operation. -func (ac *azureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armnetwork.InterfacesClientCreateOrUpdateResponse], err error) { +func (ac *AzureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armnetwork.InterfacesClientCreateOrUpdateResponse], err error) { ctx, _, done := tele.StartSpanWithLogger(ctx, "networkinterfaces.AzureClient.CreateOrUpdateAsync") defer done() @@ -96,7 +96,7 @@ func (ac *azureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.Resou // DeleteAsync deletes a network interface asynchronously. DeleteAsync sends a DELETE // request to Azure and if accepted without error, the func will return a poller which can be used to track the ongoing // progress of the operation. -func (ac *azureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string) (poller *runtime.Poller[armnetwork.InterfacesClientDeleteResponse], err error) { +func (ac *AzureClient) DeleteAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string) (poller *runtime.Poller[armnetwork.InterfacesClientDeleteResponse], err error) { ctx, _, done := tele.StartSpanWithLogger(ctx, "networkinterfaces.AzureClient.DeleteAsync") defer done() diff --git a/azure/services/roleassignments/client.go b/azure/services/roleassignments/client.go index dd7643ec8d3..2b219d17c00 100644 --- a/azure/services/roleassignments/client.go +++ b/azure/services/roleassignments/client.go @@ -59,7 +59,7 @@ func (ac *azureClient) Get(ctx context.Context, spec azure.ResourceSpecGetter) ( // CreateOrUpdateAsync creates a roleassignment. // Creating a roleassignment is not a long running operation, so we don't ever return a poller. -func (ac *azureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, resumeToken string, parameters interface{}) (result interface{}, poller *runtime.Poller[armauthorization.RoleAssignmentsClientCreateResponse], err error) { //nolint:revive // keeping resumeToken for readability +func (ac *azureClient) CreateOrUpdateAsync(ctx context.Context, spec azure.ResourceSpecGetter, _ string, parameters interface{}) (result interface{}, poller *runtime.Poller[armauthorization.RoleAssignmentsClientCreateResponse], err error) { // ignore resumeToken (3rd arg) since this is not a long-running operation ctx, _, done := tele.StartSpanWithLogger(ctx, "roleassignments.azureClient.CreateOrUpdateAsync") defer done() diff --git a/test/e2e/cni.go b/test/e2e/cni.go index e1d64e569ab..19603bf371c 100644 --- a/test/e2e/cni.go +++ b/test/e2e/cni.go @@ -45,14 +45,14 @@ const ( // EnsureCNI installs the CNI plugin depending on the input.CNIManifestPath func EnsureCNI(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, installHelmChart bool, cidrBlocks []string, hasWindows bool) { if input.CNIManifestPath != "" { - InstallCNIManifest(ctx, input, cidrBlocks, hasWindows) + InstallCNIManifest(ctx, input) } else { EnsureCalicoIsReady(ctx, input, installHelmChart, cidrBlocks, hasWindows) } } // InstallCNIManifest installs the CNI manifest provided by the user -func InstallCNIManifest(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput, cidrBlocks []string, hasWindows bool) { //nolint:revive // leaving unused cidrBlocks and hasWindows for understanding +func InstallCNIManifest(ctx context.Context, input clusterctl.ApplyCustomClusterTemplateAndWaitInput) { By("Installing a CNI plugin to the workload cluster") workloadCluster := input.ClusterProxy.GetWorkloadCluster(ctx, input.Namespace, input.ClusterName)