From 02697424803f7a1d06b1ee531ddce454df57983e Mon Sep 17 00:00:00 2001 From: swamyan Date: Fri, 29 Sep 2023 18:28:09 +0530 Subject: [PATCH] Remove nolint usages for errcheck, revive, prealloc, goconst, ineffassign --- controllers/vmware/vspherecluster_reconciler.go | 2 +- pkg/identity/identity_test.go | 3 +-- pkg/services/network/dummy_provider.go | 11 +++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/controllers/vmware/vspherecluster_reconciler.go b/controllers/vmware/vspherecluster_reconciler.go index 542ca4ebe4..6db7ba1c4f 100644 --- a/controllers/vmware/vspherecluster_reconciler.go +++ b/controllers/vmware/vspherecluster_reconciler.go @@ -285,7 +285,7 @@ func (r *ClusterReconciler) reconcileAPIEndpoints(ctx context.Context, clusterCt // Define a variable to assign the API endpoints of control plane // machines as they are discovered. - var apiEndpointList []clusterv1.APIEndpoint //nolint:prealloc + apiEndpointList := []clusterv1.APIEndpoint{} // Iterate over the cluster's control plane CAPI machines. for _, machine := range machines { diff --git a/pkg/identity/identity_test.go b/pkg/identity/identity_test.go index f9f74c6fdd..da07477200 100644 --- a/pkg/identity/identity_test.go +++ b/pkg/identity/identity_test.go @@ -28,7 +28,6 @@ import ( "sigs.k8s.io/cluster-api-provider-vsphere/pkg/manager" ) -//nolint:goconst var _ = Describe("GetCredentials", func() { var ( ns *corev1.Namespace @@ -116,7 +115,7 @@ var _ = Describe("GetCredentials", func() { if labels == nil { labels = map[string]string{} } - labels["identity-authorized"] = "true" + labels["identity-authorized"] = "true" //nolint: goconst ns.Labels = labels Expect(k8sclient.Update(ctx, ns)).To(Succeed()) diff --git a/pkg/services/network/dummy_provider.go b/pkg/services/network/dummy_provider.go index 78e5ba85a4..a0c9ce4f01 100644 --- a/pkg/services/network/dummy_provider.go +++ b/pkg/services/network/dummy_provider.go @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -//nolint:revive package network import ( @@ -39,23 +38,23 @@ func (np *dummyNetworkProvider) HasLoadBalancer() bool { return false } -func (np *dummyNetworkProvider) ProvisionClusterNetwork(ctx context.Context, clusterCtx *vmware.ClusterContext) error { +func (np *dummyNetworkProvider) ProvisionClusterNetwork(_ context.Context, _ *vmware.ClusterContext) error { return nil } -func (np *dummyNetworkProvider) GetClusterNetworkName(ctx context.Context, clusterCtx *vmware.ClusterContext) (string, error) { +func (np *dummyNetworkProvider) GetClusterNetworkName(_ context.Context, _ *vmware.ClusterContext) (string, error) { return "", nil } -func (np *dummyNetworkProvider) ConfigureVirtualMachine(ctx context.Context, clusterCtx *vmware.ClusterContext, vm *vmoprv1.VirtualMachine) error { +func (np *dummyNetworkProvider) ConfigureVirtualMachine(_ context.Context, _ *vmware.ClusterContext, _ *vmoprv1.VirtualMachine) error { return nil } -func (np *dummyNetworkProvider) GetVMServiceAnnotations(ctx context.Context, clusterCtx *vmware.ClusterContext) (map[string]string, error) { +func (np *dummyNetworkProvider) GetVMServiceAnnotations(_ context.Context, _ *vmware.ClusterContext) (map[string]string, error) { return map[string]string{}, nil } -func (np *dummyNetworkProvider) VerifyNetworkStatus(ctx context.Context, clusterCtx *vmware.ClusterContext, obj runtime.Object) error { +func (np *dummyNetworkProvider) VerifyNetworkStatus(_ context.Context, _ *vmware.ClusterContext, _ runtime.Object) error { return nil }