Skip to content

Commit

Permalink
bump golangci-lint to v1.63.4, and fix findings
Browse files Browse the repository at this point in the history
Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
  • Loading branch information
nunnatsa committed Jan 15, 2025
1 parent 6b97c45 commit 5cb3f23
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=5m -v
version: v1.59.0
version: v1.63.4

check-gen:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ goimports:

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint: ## Download golangci-lint locally if necessary.
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4)

.PHONY: linter
linter: golangci-lint
Expand Down
6 changes: 3 additions & 3 deletions controllers/kubevirtcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (r *KubevirtClusterReconciler) reconcileNormal(ctx *context.ClusterContext,
// Create the service serving as load balancer, if not existing
if !externalLoadBalancer.IsFound() {
if err := externalLoadBalancer.Create(ctx); err != nil {
conditions.MarkFalse(ctx.KubevirtCluster, infrav1.LoadBalancerAvailableCondition, infrav1.LoadBalancerProvisioningFailedReason, clusterv1.ConditionSeverityWarning, err.Error())
conditions.MarkFalse(ctx.KubevirtCluster, infrav1.LoadBalancerAvailableCondition, infrav1.LoadBalancerProvisioningFailedReason, clusterv1.ConditionSeverityWarning, "%v", err.Error())
return ctrl.Result{}, errors.Wrap(err, "failed to create load balancer")
}
}
Expand All @@ -180,7 +180,7 @@ func (r *KubevirtClusterReconciler) reconcileNormal(ctx *context.ClusterContext,
} else if ctx.KubevirtCluster.Spec.ControlPlaneServiceTemplate.Spec.Type == "LoadBalancer" {
lbip4, err := externalLoadBalancer.ExternalIP(ctx)
if err != nil {
conditions.MarkFalse(ctx.KubevirtCluster, infrav1.LoadBalancerAvailableCondition, infrav1.LoadBalancerProvisioningFailedReason, clusterv1.ConditionSeverityWarning, err.Error())
conditions.MarkFalse(ctx.KubevirtCluster, infrav1.LoadBalancerAvailableCondition, infrav1.LoadBalancerProvisioningFailedReason, clusterv1.ConditionSeverityWarning, "%v", err.Error())
return ctrl.Result{}, errors.Wrap(err, "failed to get ExternalIP for the load balancer")
}
ctx.KubevirtCluster.Spec.ControlPlaneEndpoint = infrav1.APIEndpoint{
Expand All @@ -192,7 +192,7 @@ func (r *KubevirtClusterReconciler) reconcileNormal(ctx *context.ClusterContext,
} else {
lbip4, err := externalLoadBalancer.IP(ctx)
if err != nil {
conditions.MarkFalse(ctx.KubevirtCluster, infrav1.LoadBalancerAvailableCondition, infrav1.LoadBalancerProvisioningFailedReason, clusterv1.ConditionSeverityWarning, err.Error())
conditions.MarkFalse(ctx.KubevirtCluster, infrav1.LoadBalancerAvailableCondition, infrav1.LoadBalancerProvisioningFailedReason, clusterv1.ConditionSeverityWarning, "%v", err.Error())
return ctrl.Result{}, errors.Wrap(err, "failed to get ClusterIP for the load balancer")
}
ctx.KubevirtCluster.Spec.ControlPlaneEndpoint = infrav1.APIEndpoint{
Expand Down
6 changes: 3 additions & 3 deletions controllers/kubevirtmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (r *KubevirtMachineReconciler) reconcileNormal(ctx *context.MachineContext)
if !isTerminal && !externalMachine.Exists() {
ctx.KubevirtMachine.Status.Ready = false
if err := externalMachine.Create(ctx.Context); err != nil {
conditions.MarkFalse(ctx.KubevirtMachine, infrav1.VMProvisionedCondition, infrav1.VMCreateFailedReason, clusterv1.ConditionSeverityError, fmt.Sprintf("Failed vm creation: %v", err))
conditions.MarkFalse(ctx.KubevirtMachine, infrav1.VMProvisionedCondition, infrav1.VMCreateFailedReason, clusterv1.ConditionSeverityError, "Failed vm creation: %v", err)
return ctrl.Result{}, errors.Wrap(err, "failed to create VM instance")
}
ctx.Logger.Info("VM Created, waiting on vm to be provisioned.")
Expand All @@ -278,7 +278,7 @@ func (r *KubevirtMachineReconciler) reconcileNormal(ctx *context.MachineContext)
conditions.MarkTrue(ctx.KubevirtMachine, infrav1.VMProvisionedCondition)
} else {
reason, message := externalMachine.GetVMNotReadyReason()
conditions.MarkFalse(ctx.KubevirtMachine, infrav1.VMProvisionedCondition, reason, clusterv1.ConditionSeverityInfo, message)
conditions.MarkFalse(ctx.KubevirtMachine, infrav1.VMProvisionedCondition, reason, clusterv1.ConditionSeverityInfo, "%s", message)

// Waiting for VM to boot
ctx.KubevirtMachine.Status.Ready = false
Expand Down Expand Up @@ -371,7 +371,7 @@ func (r *KubevirtMachineReconciler) reconcileNormal(ctx *context.MachineContext)
conditions.MarkTrue(ctx.KubevirtMachine, infrav1.VMLiveMigratableCondition)
} else {
conditions.MarkFalse(ctx.KubevirtMachine, infrav1.VMLiveMigratableCondition, reason, clusterv1.ConditionSeverityInfo,
fmt.Sprintf("%s is not a live migratable machine: %s", ctx.KubevirtMachine.Name, message))
"%s is not a live migratable machine: %s", ctx.KubevirtMachine.Name, message)
}

return ctrl.Result{}, nil
Expand Down
2 changes: 1 addition & 1 deletion e2e/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func DeleteAndWait(ctx context.Context, k8sclient client.Client, obj client.Obje
}
}
return fmt.Errorf("waiting on object %s to be deleted", key)
}, time.Duration(timeoutSeconds)*time.Second, 1*time.Second).Should(BeNil())
}, time.Duration(timeoutSeconds)*time.Second, 1*time.Second).Should(Succeed())
}

// RunCmd function executes a command, and returns STDOUT and STDERR bytes
Expand Down
2 changes: 1 addition & 1 deletion e2e/create-cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ var _ = Describe("CreateCluster", func() {
}

return fmt.Errorf("waiting on object %s to be deleted", key)
}, time.Duration(timeoutSeconds)*time.Second, 1*time.Second).Should(BeNil())
}, time.Duration(timeoutSeconds)*time.Second, 1*time.Second).Should(Succeed())

}

Expand Down

0 comments on commit 5cb3f23

Please sign in to comment.