Skip to content

Commit 2e29edc

Browse files
authored
Merge pull request #1652 from shiftstack/golangci-lint-1.54
🌱 Bump golangci-lint to 1.54.2
2 parents ad164b3 + bd1a730 commit 2e29edc

File tree

8 files changed

+14
-9
lines changed

8 files changed

+14
-9
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ linters:
66
- bidichk
77
- bodyclose
88
- cyclop
9-
- depguard
9+
# - depguard
1010
- dogsled
1111
- dupword
1212
- durationcheck

api/v1alpha6/conversion.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ func Convert_v1alpha6_OpenStackMachineSpec_To_v1alpha7_OpenStackMachineSpec(in *
341341
func convertNetworksToPorts(networks []NetworkParam) []infrav1.PortOpts {
342342
var ports []infrav1.PortOpts
343343

344-
for _, network := range networks {
344+
for i := range networks {
345+
network := networks[i]
346+
345347
// This will remain null if the network is not specified in NetworkParam
346348
var networkFilter *infrav1.NetworkFilter
347349

@@ -378,7 +380,8 @@ func convertNetworksToPorts(networks []NetworkParam) []infrav1.PortOpts {
378380
ports = append(ports, infrav1.PortOpts{Network: networkFilter})
379381
} else {
380382
// If the network has explicit subnets then we create a separate port for each subnet.
381-
for _, subnet := range network.Subnets {
383+
for i := range network.Subnets {
384+
subnet := network.Subnets[i]
382385
if subnet.UUID != "" {
383386
ports = append(ports, infrav1.PortOpts{
384387
Network: networkFilter,

controllers/openstackcluster_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func deleteBastion(scope scope.Scope, cluster *clusterv1.Cluster, openStackClust
258258
return nil
259259
}
260260

261-
func reconcileNormal(scope scope.Scope, cluster *clusterv1.Cluster, openStackCluster *infrav1.OpenStackCluster) (ctrl.Result, error) {
261+
func reconcileNormal(scope scope.Scope, cluster *clusterv1.Cluster, openStackCluster *infrav1.OpenStackCluster) (ctrl.Result, error) { //nolint:unparam
262262
scope.Logger().Info("Reconciling Cluster")
263263

264264
// If the OpenStackCluster doesn't have our finalizer, add it.

controllers/openstackmachine_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (r *OpenStackMachineReconciler) SetupWithManager(ctx context.Context, mgr c
218218
Complete(r)
219219
}
220220

221-
func (r *OpenStackMachineReconciler) reconcileDelete(scope scope.Scope, cluster *clusterv1.Cluster, openStackCluster *infrav1.OpenStackCluster, machine *clusterv1.Machine, openStackMachine *infrav1.OpenStackMachine) (ctrl.Result, error) {
221+
func (r *OpenStackMachineReconciler) reconcileDelete(scope scope.Scope, cluster *clusterv1.Cluster, openStackCluster *infrav1.OpenStackCluster, machine *clusterv1.Machine, openStackMachine *infrav1.OpenStackMachine) (ctrl.Result, error) { //nolint:unparam
222222
scope.Logger().Info("Reconciling Machine delete")
223223

224224
clusterName := fmt.Sprintf("%s-%s", cluster.ObjectMeta.Namespace, cluster.Name)

hack/tools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ROOT_DIR_RELATIVE := ../..
1616
include $(ROOT_DIR_RELATIVE)/common.mk
1717

18-
GOLANGCI_LINT_VERSION := v1.52.2
18+
GOLANGCI_LINT_VERSION := v1.54.2
1919

2020
UNAME := $(shell uname -s)
2121

pkg/cloud/services/networking/port_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,8 @@ func Test_GetOrCreatePort(t *testing.T) {
509509
}
510510

511511
eventObject := &infrav1.OpenStackMachine{}
512-
for _, tt := range tests {
512+
for i := range tests {
513+
tt := tests[i]
513514
t.Run(tt.name, func(t *testing.T) {
514515
g := NewWithT(t)
515516
mockClient := mock.NewMockNetworkClient(mockCtrl)

pkg/cloud/services/networking/router.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ func (s *Service) setRouterExternalIPs(openStackCluster *infrav1.OpenStackCluste
165165
},
166166
}
167167

168-
for _, externalRouterIP := range openStackCluster.Spec.ExternalRouterIPs {
168+
for i := range openStackCluster.Spec.ExternalRouterIPs {
169+
externalRouterIP := openStackCluster.Spec.ExternalRouterIPs[i]
169170
subnetID := externalRouterIP.Subnet.ID
170171
if subnetID == "" {
171172
subnet, err := s.GetSubnetByFilter(&externalRouterIP.Subnet)

test/e2e/shared/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const (
3838
OpenStackCloudYAMLFile = "OPENSTACK_CLOUD_YAML_FILE"
3939
OpenStackCloud = "OPENSTACK_CLOUD"
4040
OpenStackCloudAdmin = "OPENSTACK_CLOUD_ADMIN"
41-
OpenStackFailureDomain = "OPENSTACK_FAILURE_DOMAIN"
41+
OpenStackFailureDomain = "OPENSTACK_FAILURE_DOMAIN" //nolint:gosec // Linter thinks this could be credentials...
4242
OpenStackFailureDomainAlt = "OPENSTACK_FAILURE_DOMAIN_ALT"
4343
OpenStackVolumeTypeAlt = "OPENSTACK_VOLUME_TYPE_ALT"
4444
OpenStackImageName = "OPENSTACK_IMAGE_NAME"

0 commit comments

Comments
 (0)