Skip to content

Commit dfbd87c

Browse files
committed
lint fixes
1 parent 07e787d commit dfbd87c

File tree

7 files changed

+22
-24
lines changed

7 files changed

+22
-24
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module k8s.io/cloud-provider-aws
22

3-
go 1.23.0
3+
go 1.22.7
44

55
toolchain go1.24.3
66

pkg/controllers/tagging/tagging_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,4 @@ func syncNodeStore(nodeinformer coreinformers.NodeInformer, f *fake.Clientset) e
271271
newElems = append(newElems, &nodes.Items[i])
272272
}
273273
return nodeinformer.Informer().GetStore().Replace(newElems, "newRV")
274-
}
274+
}

pkg/providers/v1/aws.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ import (
3030
"time"
3131

3232
"github.com/aws/aws-sdk-go-v2/aws"
33-
awsConfig "github.com/aws/aws-sdk-go-v2/config"
3433
"github.com/aws/aws-sdk-go-v2/aws/retry"
34+
awsConfig "github.com/aws/aws-sdk-go-v2/config"
3535
"github.com/aws/aws-sdk-go-v2/credentials/stscreds"
36+
stscredsv2 "github.com/aws/aws-sdk-go-v2/credentials/stscreds"
3637
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
37-
"github.com/aws/aws-sdk-go-v2/service/ec2"
3838
"github.com/aws/aws-sdk-go-v2/service/autoscaling"
39+
"github.com/aws/aws-sdk-go-v2/service/ec2"
3940
ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types"
4041
elb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing"
4142
elbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types"
4243
elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2"
4344
elbv2types "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types"
44-
stscredsv2 "github.com/aws/aws-sdk-go-v2/credentials/stscreds"
4545
"github.com/aws/aws-sdk-go-v2/service/kms"
4646
"github.com/aws/smithy-go"
4747
"gopkg.in/gcfg.v1"
@@ -60,14 +60,14 @@ import (
6060
"k8s.io/client-go/tools/cache"
6161
"k8s.io/client-go/tools/record"
6262
cloudprovider "k8s.io/cloud-provider"
63+
"k8s.io/cloud-provider-aws/pkg/services"
6364
nodehelpers "k8s.io/cloud-provider/node/helpers"
6465
servicehelpers "k8s.io/cloud-provider/service/helpers"
6566
cloudvolume "k8s.io/cloud-provider/volume"
6667
volerr "k8s.io/cloud-provider/volume/errors"
6768
volumehelpers "k8s.io/cloud-provider/volume/helpers"
6869
"k8s.io/klog/v2"
6970
netutils "k8s.io/utils/net"
70-
"k8s.io/cloud-provider-aws/pkg/services"
7171
)
7272

7373
// NLBHealthCheckRuleDescription is the comment used on a security group rule to
@@ -796,7 +796,6 @@ func newAWSSDKProvider(creds aws.CredentialsProvider, cfg *CloudConfig) *awsSDKP
796796
}
797797
}
798798

799-
800799
// Get a CrossRequestRetryDelay, scoped to the region, not to the request.
801800
// This means that when we hit a limit on a call, we will delay _all_ calls to the API.
802801
// We do this to protect the AWS account from becoming overloaded and effectively locked.
@@ -1374,15 +1373,15 @@ func newAWSCloud(cfg CloudConfig, awsServices Services, credentials *stscreds.As
13741373
}
13751374

13761375
awsCloud := &Cloud{
1377-
ec2: ec2,
1378-
elb: elb,
1379-
elbv2: elbv2,
1380-
asg: asg,
1381-
metadata: metadata,
1382-
kms: kms,
1383-
cfg: &cfg,
1384-
region: regionName,
1385-
1376+
ec2: ec2,
1377+
elb: elb,
1378+
elbv2: elbv2,
1379+
asg: asg,
1380+
metadata: metadata,
1381+
kms: kms,
1382+
cfg: &cfg,
1383+
region: regionName,
1384+
13861385
attaching: make(map[types.NodeName]map[mountDevice]EBSVolumeID),
13871386
deviceAllocators: make(map[types.NodeName]DeviceAllocator),
13881387
}

pkg/providers/v1/aws_sdk_client_middleware.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/aws/aws-sdk-go-v2/aws"
99
"github.com/aws/aws-sdk-go-v2/aws/middleware"
1010
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
11-
"github.com/aws/aws-sdk-go-v2/service/ec2"
1211
"github.com/aws/aws-sdk-go-v2/service/autoscaling"
12+
"github.com/aws/aws-sdk-go-v2/service/ec2"
1313
elb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing"
1414
elbv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2"
1515
"github.com/aws/aws-sdk-go-v2/service/kms"
@@ -19,7 +19,6 @@ import (
1919
"k8s.io/client-go/pkg/version"
2020
)
2121

22-
2322
// Adds middleware to AWS SDK Go V2 clients.
2423
func (p *awsSDKProvider) AddMiddleware(ctx context.Context, regionName string, cfg *aws.Config) {
2524
cfg.APIOptions = append(cfg.APIOptions,
@@ -320,4 +319,4 @@ func (r *AutoscalingResolver) ResolveEndpoint(
320319
}
321320
}
322321
return r.Resolver.ResolveEndpoint(ctx, params)
323-
}
322+
}

pkg/providers/v1/aws_sdk_client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,4 +738,4 @@ func TestClientsWithRetry(t *testing.T) {
738738
}
739739
_, err = autoscalingClient.DescribeAutoScalingGroups(context.TODO(), &autoscaling.DescribeAutoScalingGroupsInput{})
740740
assert.True(t, attemptCount > 1, fmt.Sprintf("expected an attempt count of >1 for Autoscaling client, got %d", attemptCount))
741-
}
741+
}

pkg/providers/v1/aws_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ func TestGetVolumeLabels(t *testing.T) {
16141614
},
16151615
})
16161616

1617-
labels, err := c.GetVolumeLabels(context.TODO(), KubernetesVolumeID("aws:///" + string(volumeID)))
1617+
labels, err := c.GetVolumeLabels(context.TODO(), KubernetesVolumeID("aws:///"+string(volumeID)))
16181618

16191619
assert.Nil(t, err, "Error creating Volume %v", err)
16201620
assert.Equal(t, map[string]string{
@@ -2453,7 +2453,7 @@ func TestCreateDisk(t *testing.T) {
24532453
describeVolumesRequest := &ec2.DescribeVolumesInput{
24542454
VolumeIds: []string{"vol-volumeId0"},
24552455
}
2456-
awsServices.ec2.(*MockedFakeEC2).On("DescribeVolumes", context.TODO(), describeVolumesRequest).Return([]ec2types.Volume{ec2types.Volume{
2456+
awsServices.ec2.(*MockedFakeEC2).On("DescribeVolumes", context.TODO(), describeVolumesRequest).Return([]ec2types.Volume{{
24572457
AvailabilityZone: aws.String("us-east-1a"),
24582458
VolumeId: aws.String("vol-volumeId0"),
24592459
State: ec2types.VolumeStateAvailable,
@@ -3868,7 +3868,7 @@ func TestDescribeInstances(t *testing.T) {
38683868
},
38693869
nil,
38703870
)
3871-
m.On("DescribeInstances",
3871+
m.On("DescribeInstances",
38723872
&ec2.DescribeInstancesInput{
38733873
MaxResults: aws.Int32(1000),
38743874
NextToken: aws.String("asdf"),

pkg/services/aws_sts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ func NewStsClient(ctx context.Context, region, roleARN, sourceARN string) (*sts.
9494

9595
klog.V(4).Infof("configuring STS client with extra headers, %v", reqHeaders)
9696
return stsClient, nil
97-
}
97+
}

0 commit comments

Comments
 (0)