Skip to content

Commit

Permalink
Merge pull request #1652 from shiftstack/golangci-lint-1.54
Browse files Browse the repository at this point in the history
🌱 Bump golangci-lint to 1.54.2
  • Loading branch information
k8s-ci-robot authored Sep 7, 2023
2 parents ad164b3 + bd1a730 commit 2e29edc
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ linters:
- bidichk
- bodyclose
- cyclop
- depguard
# - depguard
- dogsled
- dupword
- durationcheck
Expand Down
7 changes: 5 additions & 2 deletions api/v1alpha6/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ func Convert_v1alpha6_OpenStackMachineSpec_To_v1alpha7_OpenStackMachineSpec(in *
func convertNetworksToPorts(networks []NetworkParam) []infrav1.PortOpts {
var ports []infrav1.PortOpts

for _, network := range networks {
for i := range networks {
network := networks[i]

// This will remain null if the network is not specified in NetworkParam
var networkFilter *infrav1.NetworkFilter

Expand Down Expand Up @@ -378,7 +380,8 @@ func convertNetworksToPorts(networks []NetworkParam) []infrav1.PortOpts {
ports = append(ports, infrav1.PortOpts{Network: networkFilter})
} else {
// If the network has explicit subnets then we create a separate port for each subnet.
for _, subnet := range network.Subnets {
for i := range network.Subnets {
subnet := network.Subnets[i]
if subnet.UUID != "" {
ports = append(ports, infrav1.PortOpts{
Network: networkFilter,
Expand Down
2 changes: 1 addition & 1 deletion controllers/openstackcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func deleteBastion(scope scope.Scope, cluster *clusterv1.Cluster, openStackClust
return nil
}

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

// If the OpenStackCluster doesn't have our finalizer, add it.
Expand Down
2 changes: 1 addition & 1 deletion controllers/openstackmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (r *OpenStackMachineReconciler) SetupWithManager(ctx context.Context, mgr c
Complete(r)
}

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

clusterName := fmt.Sprintf("%s-%s", cluster.ObjectMeta.Namespace, cluster.Name)
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ROOT_DIR_RELATIVE := ../..
include $(ROOT_DIR_RELATIVE)/common.mk

GOLANGCI_LINT_VERSION := v1.52.2
GOLANGCI_LINT_VERSION := v1.54.2

UNAME := $(shell uname -s)

Expand Down
3 changes: 2 additions & 1 deletion pkg/cloud/services/networking/port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ func Test_GetOrCreatePort(t *testing.T) {
}

eventObject := &infrav1.OpenStackMachine{}
for _, tt := range tests {
for i := range tests {
tt := tests[i]
t.Run(tt.name, func(t *testing.T) {
g := NewWithT(t)
mockClient := mock.NewMockNetworkClient(mockCtrl)
Expand Down
3 changes: 2 additions & 1 deletion pkg/cloud/services/networking/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ func (s *Service) setRouterExternalIPs(openStackCluster *infrav1.OpenStackCluste
},
}

for _, externalRouterIP := range openStackCluster.Spec.ExternalRouterIPs {
for i := range openStackCluster.Spec.ExternalRouterIPs {
externalRouterIP := openStackCluster.Spec.ExternalRouterIPs[i]
subnetID := externalRouterIP.Subnet.ID
if subnetID == "" {
subnet, err := s.GetSubnetByFilter(&externalRouterIP.Subnet)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/shared/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
OpenStackCloudYAMLFile = "OPENSTACK_CLOUD_YAML_FILE"
OpenStackCloud = "OPENSTACK_CLOUD"
OpenStackCloudAdmin = "OPENSTACK_CLOUD_ADMIN"
OpenStackFailureDomain = "OPENSTACK_FAILURE_DOMAIN"
OpenStackFailureDomain = "OPENSTACK_FAILURE_DOMAIN" //nolint:gosec // Linter thinks this could be credentials...
OpenStackFailureDomainAlt = "OPENSTACK_FAILURE_DOMAIN_ALT"
OpenStackVolumeTypeAlt = "OPENSTACK_VOLUME_TYPE_ALT"
OpenStackImageName = "OPENSTACK_IMAGE_NAME"
Expand Down

0 comments on commit 2e29edc

Please sign in to comment.