diff --git a/.golangci.yml b/.golangci.yml index 4b8b28a..350b052 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,6 @@ run: deadline: 3m +issues: skip-dirs: - mock* skip-files: @@ -7,22 +8,16 @@ run: - ".*conversion.*\\.go$" linters: enable: - - golint - govet - gofmt - - structcheck - - varcheck - - interfacer - unconvert - ineffassign - goconst # - gocyclo - - maligned - misspell - nakedret - prealloc - gosec - - deadcode disable-all: true # Run with --fast=false for more extensive checks fast: true diff --git a/Makefile b/Makefile index 78089ad..1bd6e7b 100644 --- a/Makefile +++ b/Makefile @@ -86,11 +86,11 @@ ENVSUBST_VER := v2.0.0-20210730161058-179042472c46 ENVSUBST_BIN := envsubst ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)-$(ENVSUBST_VER) -GOLANGCI_LINT_VER := v1.54.1 +GOLANGCI_LINT_VER := v1.64.5 GOLANGCI_LINT_BIN := golangci-lint GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER) -KUSTOMIZE_VER := v5.0.3 +KUSTOMIZE_VER := v5.6.0 KUSTOMIZE_BIN := kustomize KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER) diff --git a/controllers/azurestackhciloadbalancer_controller.go b/controllers/azurestackhciloadbalancer_controller.go index e640130..c9c1d59 100644 --- a/controllers/azurestackhciloadbalancer_controller.go +++ b/controllers/azurestackhciloadbalancer_controller.go @@ -263,7 +263,8 @@ func (r *AzureStackHCILoadBalancerReconciler) reconcileLoadBalancerServiceStatus loadBalancerScope.SetAddress(*((*lb.FrontendIPConfigurations)[0].IPAddress)) } - loadBalancerScope.SetReadyReplicas(int32(lb.ReplicationCount)) + // Assume that overflow will not happen for G115 + loadBalancerScope.SetReadyReplicas(int32(lb.ReplicationCount)) //nolint return nil } diff --git a/controllers/azurestackhciloadbalancer_virtualmachine.go b/controllers/azurestackhciloadbalancer_virtualmachine.go index 60cb880..602a86b 100644 --- a/controllers/azurestackhciloadbalancer_virtualmachine.go +++ b/controllers/azurestackhciloadbalancer_virtualmachine.go @@ -356,7 +356,8 @@ func (r *AzureStackHCILoadBalancerReconciler) updateReplicaStatus(lbs *scope.Loa // getMachineReplicaCounts calculates the replica counts for the AzureStackHCIVirtualMachines associated with the load balancer func (r *AzureStackHCILoadBalancerReconciler) getMachineReplicaCounts(vmList []*infrav1.AzureStackHCIVirtualMachine) (replicas, failedReplicas int32) { - replicas = int32(len(vmList)) + // Assume replicas will be under uniteger overflow for G115 + replicas = int32(len(vmList)) //nolint for _, vm := range vmList { if vm.Status.VMState == nil { continue