Skip to content

Commit

Permalink
Bump to golangci-lint v1.60.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Jan 20, 2025
1 parent 23c82b9 commit ac77765
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # tag=v6.1.1
with:
version: v1.59.0
version: v1.60.2
args: --out-format=colored-line-number
working-directory: ${{matrix.working-directory}}
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ linters:
- whitespace

linters-settings:
gosec:
excludes:
# integer overflow conversion int -> int32
- G115
gci:
sections:
- standard # Standard section: captures all standard packages.
Expand Down Expand Up @@ -324,3 +328,6 @@ issues:
- stylecheck
text: ST1021|ST1020
path: ^(apis/(v1alpha3|v1alpha4)\/.*)\.go$
- linters:
- govet
text: "non-constant format string in call to sigs\\.k8s\\.io\\/cluster-api\\/util\\/conditions\\."
4 changes: 2 additions & 2 deletions controllers/vspherecluster_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ func (r *clusterReconciler) reconcileDelete(ctx context.Context, clusterCtx *cap
if ctrlutil.RemoveFinalizer(secret, infrav1.SecretIdentitySetFinalizer) {
log.Info(fmt.Sprintf("Removing finalizer %s", infrav1.SecretIdentitySetFinalizer), "Secret", klog.KObj(secret))
if err := r.Client.Update(ctx, secret); err != nil {
return reconcile.Result{}, pkgerrors.Wrapf(err, fmt.Sprintf("failed to update Secret %s", klog.KObj(secret)))
return reconcile.Result{}, pkgerrors.Wrapf(err, "failed to update Secret %s", klog.KObj(secret))
}
}

if secret.DeletionTimestamp.IsZero() {
log.Info("Deleting Secret", "Secret", klog.KObj(secret))
if err := r.Client.Delete(ctx, secret); err != nil {
return reconcile.Result{}, pkgerrors.Wrapf(err, fmt.Sprintf("failed to delete Secret %s", klog.KObj(secret)))
return reconcile.Result{}, pkgerrors.Wrapf(err, "failed to delete Secret %s", klog.KObj(secret))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/vsphereclusteridentity_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ func (r clusterIdentityReconciler) reconcileDelete(ctx context.Context, identity
if ctrlutil.RemoveFinalizer(secret, infrav1.SecretIdentitySetFinalizer) {
log.Info(fmt.Sprintf("Removing finalizer %s", infrav1.SecretIdentitySetFinalizer), "Secret", klog.KObj(secret))
if err := r.Client.Update(ctx, secret); err != nil {
return errors.Wrapf(err, fmt.Sprintf("failed to update Secret %s", klog.KObj(secret)))
return errors.Wrapf(err, "failed to update Secret %s", klog.KObj(secret))
}
}

if secret.DeletionTimestamp.IsZero() {
log.Info("Deleting Secret", "Secret", klog.KObj(secret))
if err := r.Client.Delete(ctx, secret); err != nil {
return errors.Wrapf(err, fmt.Sprintf("failed to delete Secret %s", klog.KObj(secret)))
return errors.Wrapf(err, "failed to delete Secret %s", klog.KObj(secret))
}
}

Expand Down
4 changes: 2 additions & 2 deletions controllers/vspherevm_ipaddress_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ func (r vmReconciler) deleteIPAddressClaims(ctx context.Context, vmCtx *capvcont
if apierrors.IsNotFound(err) {
continue
}
return errors.Wrapf(err, fmt.Sprintf("failed to get IPAddressClaim %q to remove the finalizer", ipAddrClaimName))
return errors.Wrapf(err, "failed to get IPAddressClaim %q to remove the finalizer", ipAddrClaimName)
}

if ctrlutil.RemoveFinalizer(ipAddrClaim, infrav1.IPAddressClaimFinalizer) {
log.Info(fmt.Sprintf("Removing finalizer %s", infrav1.IPAddressClaimFinalizer), "IPAddressClaim", klog.KObj(ipAddrClaim))
if err := vmCtx.Client.Update(ctx, ipAddrClaim); err != nil {
return errors.Wrapf(err, fmt.Sprintf("failed to update IPAddressClaim %s", klog.KObj(ipAddrClaim)))
return errors.Wrapf(err, "failed to update IPAddressClaim %s", klog.KObj(ipAddrClaim))
}
}
}
Expand Down

0 comments on commit ac77765

Please sign in to comment.