Skip to content

Commit 5541d6e

Browse files
committed
golangci-lint: Silence new offenses
Linters have picked up a couple of new offenses. Add new exclusion rules.
1 parent 4201766 commit 5541d6e

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.golangci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,13 @@ issues:
157157
- linters:
158158
- revive
159159
- stylecheck
160-
path: (test)/.*.go
160+
path: (.+)_test\.go|(test)/.*.go
161161
text: should not use dot imports
162+
- linters:
163+
- revive
164+
- stylecheck
165+
path: (.+)_test\.go|(test)/.*.go
166+
text: unused-parameter
162167
- linters:
163168
- revive
164169
path: test/e2e/shared/defaults.go

controllers/openstackcluster_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ func reconcileNetworkComponents(scope scope.Scope, cluster *clusterv1.Cluster, o
566566
// Set APIEndpoints so the Cluster API Cluster Controller can pull them
567567
openStackCluster.Spec.ControlPlaneEndpoint = clusterv1.APIEndpoint{
568568
Host: host,
569+
//nolint:gosec // disable G115
569570
Port: int32(apiServerPort),
570571
}
571572
}

pkg/cloud/services/networking/securitygroups.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ func (s *Service) ReconcileSecurityGroups(openStackCluster *infrav1.OpenStackClu
7171
for k, desiredSecGroup := range desiredSecGroups {
7272
var err error
7373
observedSecGroups[k], err = s.getSecurityGroupByName(desiredSecGroup.Name)
74-
7574
if err != nil {
7675
return err
7776
}

test/e2e/shared/exec.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func executeCommand(ctx context.Context, p commandParameter) error {
146146
return fmt.Errorf("unable to send command %q: %s", "sudo "+p.cmd.cmd, err)
147147
}
148148
result := strings.TrimSuffix(stdoutBuf.String(), "\n") + "\n" + strings.TrimSuffix(stderrBuf.String(), "\n")
149+
//nolint:gosec // disable G306
149150
if err := os.WriteFile(logFile, []byte(result), os.ModePerm); err != nil {
150151
return fmt.Errorf("error writing log file: %s", err)
151152
}

0 commit comments

Comments
 (0)