Skip to content

Commit 8353ac4

Browse files
Merge pull request #8291 from r4f4/bump-golangci-lint-1.54.2
no-jira: bump golangci lint to 1.54.2
2 parents e87c42a + f817803 commit 8353ac4

File tree

7 files changed

+36
-9
lines changed

7 files changed

+36
-9
lines changed

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ run:
22
timeout: 20m
33
skip-dirs:
44
- ^bin
5+
- ^cluster-api
56
- ^data/data
67
- ^docs
78
- ^hack

hack/go-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ podman run --rm \
55
--env IS_CONTAINER=TRUE \
66
--volume "${PWD}:/go/src/github.com/openshift/installer:z" \
77
--workdir /go/src/github.com/openshift/installer \
8-
docker.io/golangci/golangci-lint:v1.53.1 \
8+
docker.io/golangci/golangci-lint:v1.54.2 \
99
golangci-lint run --new-from-rev=dcf8122 "${@}"

pkg/asset/machines/clusterapi.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ func (c *ClusterAPI) Generate(dependencies asset.Parents) error {
457457
func (c *ClusterAPI) Files() []*asset.File {
458458
files := []*asset.File{}
459459
for _, f := range c.FileList {
460+
f := f // TODO: remove with golang 1.22
460461
files = append(files, &f.File)
461462
}
462463
return files
@@ -499,7 +500,8 @@ func (c *ClusterAPI) Load(f asset.FileFetcher) (bool, error) {
499500
c.FileList = append(c.FileList, &asset.RuntimeFile{
500501
File: asset.File{
501502
Filename: file.Filename,
502-
Data: file.Data},
503+
Data: file.Data,
504+
},
503505
Object: obj.(client.Object),
504506
})
505507
}

pkg/asset/manifests/aws/zones_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ import (
1818
awstypes "github.com/openshift/installer/pkg/types/aws"
1919
)
2020

21-
var (
22-
stubDefaultCIDR = "10.0.0.0/16"
23-
)
21+
var stubDefaultCIDR = "10.0.0.0/16"
2422

2523
func stubClusterID() *installconfig.ClusterID {
2624
return &installconfig.ClusterID{
@@ -274,6 +272,7 @@ func Test_setSubnetsManagedVPC(t *testing.T) {
274272
},
275273
}
276274
for _, tt := range tests {
275+
tt := tt // TODO: remove with golang 1.22
277276
t.Run(tt.name, func(t *testing.T) {
278277
err := setSubnetsManagedVPC(tt.args.in)
279278
if (err != nil) != tt.wantErr {
@@ -487,6 +486,7 @@ func Test_setSubnetsBYOVPC(t *testing.T) {
487486
},
488487
}
489488
for _, tt := range tests {
489+
tt := tt // TODO: remove with golang 1.22
490490
t.Run(tt.name, func(t *testing.T) {
491491
err := setSubnetsBYOVPC(tt.args.in)
492492
if (err != nil) != tt.wantErr {

pkg/asset/manifests/clusterapi/cluster.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func (c *Cluster) Generate(dependencies asset.Parents) error {
176176
func (c *Cluster) Files() []*asset.File {
177177
files := []*asset.File{}
178178
for _, f := range c.FileList {
179+
f := f // TODO: remove with golang 1.22
179180
files = append(files, &f.File)
180181
}
181182
return files
@@ -218,7 +219,8 @@ func (c *Cluster) Load(f asset.FileFetcher) (bool, error) {
218219
c.FileList = append(c.FileList, &asset.RuntimeFile{
219220
File: asset.File{
220221
Filename: file.Filename,
221-
Data: file.Data},
222+
Data: file.Data,
223+
},
222224
Object: obj.(client.Object),
223225
})
224226
}

pkg/infrastructure/aws/sdk/provision_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ func TestEnsureVPC(t *testing.T) {
352352
logger.SetOutput(io.Discard)
353353

354354
for _, test := range tests {
355+
test := test // TODO: remove with golang 1.22
355356
t.Run(test.name, func(t *testing.T) {
356357
state := vpcState{
357358
input: &vpcInputOptions{
@@ -509,6 +510,7 @@ func TestEnsureIntergetGateway(t *testing.T) {
509510
logger.SetOutput(io.Discard)
510511

511512
for _, test := range tests {
513+
test := test // TODO: remove with golang 1.22
512514
t.Run(test.name, func(t *testing.T) {
513515
state := vpcState{
514516
input: &vpcInputOptions{
@@ -653,6 +655,7 @@ func TestEnsureDHCPOptions(t *testing.T) {
653655
logger.SetOutput(io.Discard)
654656

655657
for _, test := range tests {
658+
test := test // TODO: remove with golang 1.22
656659
t.Run(test.name, func(t *testing.T) {
657660
state := vpcState{
658661
input: &vpcInputOptions{
@@ -763,6 +766,7 @@ func TestEnsureRouteTable(t *testing.T) {
763766
logger.SetOutput(io.Discard)
764767

765768
for _, test := range tests {
769+
test := test // TODO: remove with golang 1.22
766770
t.Run(test.name, func(t *testing.T) {
767771
state := vpcState{
768772
input: &vpcInputOptions{
@@ -1024,6 +1028,7 @@ func TestEnsurePublicRouteTable(t *testing.T) {
10241028
logger.SetOutput(io.Discard)
10251029

10261030
for _, test := range tests {
1031+
test := test // TODO: remove with golang 1.22
10271032
t.Run(test.name, func(t *testing.T) {
10281033
state := vpcState{
10291034
input: &vpcInputOptions{
@@ -1136,6 +1141,7 @@ func TestEnsureSubnet(t *testing.T) {
11361141
logger.SetOutput(io.Discard)
11371142

11381143
for _, test := range tests {
1144+
test := test // TODO: remove with golang 1.22
11391145
t.Run(test.name, func(t *testing.T) {
11401146
state := vpcState{
11411147
input: &vpcInputOptions{
@@ -1291,6 +1297,7 @@ func TestEnsurePublicSubnets(t *testing.T) {
12911297
logger.SetOutput(io.Discard)
12921298

12931299
for _, test := range tests {
1300+
test := test // TODO: remove with golang 1.22
12941301
t.Run(test.name, func(t *testing.T) {
12951302
state := vpcState{
12961303
input: &vpcInputOptions{
@@ -1414,6 +1421,7 @@ func TestEnsurePrivateSubnets(t *testing.T) {
14141421
logger.SetOutput(io.Discard)
14151422

14161423
for _, test := range tests {
1424+
test := test // TODO: remove with golang 1.22
14171425
t.Run(test.name, func(t *testing.T) {
14181426
state := vpcState{
14191427
input: &vpcInputOptions{
@@ -1571,6 +1579,7 @@ func TestEnsureEIP(t *testing.T) {
15711579
logger.SetOutput(io.Discard)
15721580

15731581
for _, test := range tests {
1582+
test := test // TODO: remove with golang 1.22
15741583
t.Run(test.name, func(t *testing.T) {
15751584
res, err := ensureEIP(context.TODO(), &test.mockSvc, map[string]string{})
15761585
if test.expectedErr == "" {
@@ -1695,6 +1704,7 @@ func TestEnsureNatGateway(t *testing.T) {
16951704
logger.SetOutput(io.Discard)
16961705

16971706
for _, test := range tests {
1707+
test := test // TODO: remove with golang 1.22
16981708
t.Run(test.name, func(t *testing.T) {
16991709
state := vpcState{
17001710
input: &vpcInputOptions{
@@ -1855,6 +1865,7 @@ func TestEnsurePrivateRouteTable(t *testing.T) {
18551865
logger.SetOutput(io.Discard)
18561866

18571867
for _, test := range tests {
1868+
test := test // TODO: remove with golang 1.22
18581869
t.Run(test.name, func(t *testing.T) {
18591870
state := vpcState{
18601871
input: &vpcInputOptions{
@@ -1953,6 +1964,7 @@ func TestEnsureS3VPCEndpoint(t *testing.T) {
19531964
logger.SetOutput(io.Discard)
19541965

19551966
for _, test := range tests {
1967+
test := test // TODO: remove with golang 1.22
19561968
t.Run(test.name, func(t *testing.T) {
19571969
state := vpcState{
19581970
input: &vpcInputOptions{
@@ -2048,6 +2060,7 @@ func TestEnsureUserVpc(t *testing.T) {
20482060
logger.SetOutput(io.Discard)
20492061

20502062
for _, test := range tests {
2063+
test := test // TODO: remove with golang 1.22
20512064
t.Run(test.name, func(t *testing.T) {
20522065
input := &vpcInputOptions{
20532066
infraID: "infraID",
@@ -2241,6 +2254,7 @@ func TestEnsureSecurityGroup(t *testing.T) {
22412254
logger.SetOutput(io.Discard)
22422255

22432256
for _, test := range tests {
2257+
test := test // TODO: remove with golang 1.22
22442258
t.Run(test.name, func(t *testing.T) {
22452259
res, err := ensureSecurityGroup(context.TODO(), logger, &test.mockSvc, "infraID", "vpc-1", "node-sg", map[string]string{"custom-tag": "custom-value"})
22462260
if test.expectedErr == "" {
@@ -2588,6 +2602,7 @@ func TestCreateSecurityGroups(t *testing.T) {
25882602
logger.SetOutput(io.Discard)
25892603

25902604
for _, test := range tests {
2605+
test := test // TODO: remove with golang 1.22
25912606
t.Run(test.name, func(t *testing.T) {
25922607
input := sgInputOptions{
25932608
infraID: "infraID",
@@ -2793,6 +2808,7 @@ func TestEnsureInstance(t *testing.T) {
27932808
logger.SetOutput(io.Discard)
27942809

27952810
for _, test := range tests {
2811+
test := test // TODO: remove with golang 1.22
27962812
t.Run(test.name, func(t *testing.T) {
27972813
input := instanceInputOptions{
27982814
infraID: "infraID",
@@ -3145,6 +3161,7 @@ func TestEnsureInstanceProfile(t *testing.T) {
31453161
logger.SetOutput(io.Discard)
31463162

31473163
for _, test := range tests {
3164+
test := test // TODO: remove with golang 1.22
31483165
t.Run(test.name, func(t *testing.T) {
31493166
input := instanceProfileOptions{
31503167
namePrefix: "name",
@@ -3274,6 +3291,7 @@ func TestEnsureTargetGroup(t *testing.T) {
32743291
logger.SetOutput(io.Discard)
32753292

32763293
for _, test := range tests {
3294+
test := test // TODO: remove with golang 1.22
32773295
t.Run(test.name, func(t *testing.T) {
32783296
res, err := ensureTargetGroup(context.TODO(), logger, &test.mockSvc, "tgName", "vpc-1", readyzPath, apiPort, map[string]string{})
32793297
if test.expectedErr == "" {
@@ -3383,6 +3401,7 @@ func TestEnsureLoadBalancer(t *testing.T) {
33833401
logger.SetOutput(io.Discard)
33843402

33853403
for _, test := range tests {
3404+
test := test // TODO: remove with golang 1.22
33863405
t.Run(test.name, func(t *testing.T) {
33873406
res, err := ensureLoadBalancer(context.TODO(), logger, &test.mockSvc, "lbName", []string{}, true, map[string]string{})
33883407
if test.expectedErr == "" {
@@ -3765,6 +3784,7 @@ func TestEnsureInternalLoadBalancer(t *testing.T) {
37653784
logger.SetOutput(io.Discard)
37663785

37673786
for _, test := range tests {
3787+
test := test // TODO: remove with golang 1.22
37683788
t.Run(test.name, func(t *testing.T) {
37693789
state := lbState{
37703790
input: &lbInputOptions{
@@ -4001,6 +4021,7 @@ func TestEnsureExternalLoadBalancer(t *testing.T) {
40014021
logger.SetOutput(io.Discard)
40024022

40034023
for _, test := range tests {
4024+
test := test // TODO: remove with golang 1.22
40044025
t.Run(test.name, func(t *testing.T) {
40054026
state := lbState{
40064027
input: &lbInputOptions{
@@ -4311,6 +4332,7 @@ func TestEnsurePrivateHostedZone(t *testing.T) {
43114332
tags: map[string]string{"custom-tag": "custom-value"},
43124333
}
43134334
for _, test := range tests {
4335+
test := test // TODO: remove with golang 1.22
43144336
t.Run(test.name, func(t *testing.T) {
43154337
res, err := ensurePrivateZone(context.TODO(), logger, &test.mockSvc, &input)
43164338
if test.expectedErr == "" {

pkg/types/ibmcloud/platform.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const (
1818
IBMCloudServiceDNSServicesVar string = "IBMCLOUD_PRIVATE_DNS_API_ENDPOINT"
1919

2020
// IBMCloudServiceGlobalSearchVar is the variable name used by the IBM Cloud Terraform Provider to override the Global Search endpoint.
21-
IBMCloudServiceGlobalSearchVar string = "IBMCLOUD_GS_API_ENDPOINT"
21+
IBMCloudServiceGlobalSearchVar string = "IBMCLOUD_GS_API_ENDPOINT" //nolint:gosec // not hardcoded creds
2222

2323
// IBMCloudServiceGlobalTaggingVar is the variable name used by the IBM Cloud Terraform Provider to override the Global Tagging endpoint.
24-
IBMCloudServiceGlobalTaggingVar string = "IBMCLOUD_GT_API_ENDPOINT"
24+
IBMCloudServiceGlobalTaggingVar string = "IBMCLOUD_GT_API_ENDPOINT" //nolint:gosec // not hardcoded creds
2525

2626
// IBMCloudServiceHyperProtectVar is the variable name used by the IBM Cloud Terraform Provider to override the Hyper Protect endpoint.
2727
IBMCloudServiceHyperProtectVar string = "IBMCLOUD_HPCS_API_ENDPOINT"
@@ -30,7 +30,7 @@ const (
3030
IBMCloudServiceIAMVar string = "IBMCLOUD_IAM_API_ENDPOINT"
3131

3232
// IBMCloudServiceKeyProtectVar is the variable name used by the IBM Cloud Terraform Provider to override the Key Protect endpoint.
33-
IBMCloudServiceKeyProtectVar string = "IBMCLOUD_KP_API_ENDPOINT"
33+
IBMCloudServiceKeyProtectVar string = "IBMCLOUD_KP_API_ENDPOINT" //nolint:gosec // not hardcoded creds
3434

3535
// IBMCloudServiceResourceControllerVar is the variable name used by the IBM Cloud Terraform Provider to override the Resource Controller endpoint.
3636
IBMCloudServiceResourceControllerVar string = "IBMCLOUD_RESOURCE_CONTROLLER_API_ENDPOINT"

0 commit comments

Comments
 (0)