Skip to content

Commit 2bdda7d

Browse files
committed
fix: bump golangci-lint to work with go 1.24+ to v2.7.0
1 parent ea774f5 commit 2bdda7d

File tree

15 files changed

+56
-14
lines changed

15 files changed

+56
-14
lines changed

.github/workflows/pr-golangci-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: golangci-lint
2929
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47 # tag=v9.0.0
3030
with:
31-
version: v2.1.0
31+
version: v2.7.0
3232
working-directory: ${{matrix.working-directory}}
3333
- name: Lint API
3434
run: make lint-api

.golangci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,38 @@ linters:
297297
path: .*(api|types|test)\/.*\/.*conversion.*\.go$
298298
# This rule warns when initialism, variable or package naming conventions are not followed.
299299
text: "var-naming: don't use underscores in Go names"
300+
- linters:
301+
- revive
302+
path: 'exp/utils/*'
303+
text: 'var-naming: avoid meaningless package names'
304+
- linters:
305+
- revive
306+
path: 'cmd/clusterawsadm/cmd/ami/common'
307+
text: 'var-naming: avoid meaningless package names'
308+
- linters:
309+
- revive
310+
path: 'cmd/clusterawsadm/cmd/util'
311+
text: 'var-naming: avoid meaningless package names'
312+
- linters:
313+
- revive
314+
path: 'pkg/utils'
315+
text: 'var-naming: avoid meaningless package names'
316+
- linters:
317+
- revive
318+
path: 'pkg/cloud/services/common/'
319+
text: 'var-naming: avoid meaningless package names'
320+
- linters:
321+
- revive
322+
path: 'test/e2e/shared/'
323+
text: 'var-naming: avoid meaningless package names'
324+
- linters:
325+
- revive
326+
text: 'avoid package names that conflict with Go standard library package names'
327+
path: 'pkg/internal/bytes/'
328+
- linters:
329+
- revive
330+
text: 'avoid package names that conflict with Go standard library package names'
331+
path: 'pkg/hash/'
300332
- linters:
301333
- unparam
302334
text: always receives
@@ -330,6 +362,9 @@ linters:
330362
- linters:
331363
- staticcheck
332364
text: 'SA1019: "sigs.k8s.io/cluster-api/(.*)" is deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped.'
365+
- linters:
366+
- staticcheck
367+
text: "s.scope.ControlPlaneLoadBalancer is deprecated"
333368
paths:
334369
- third_party$
335370
- builtin$

api/v1beta1/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type AWSResourceReference struct {
3232

3333
// ARN of resource.
3434
// +optional
35+
//
3536
// Deprecated: This field has no function and is going to be removed in the next release.
3637
ARN *string `json:"arn,omitempty"`
3738

hack/tools/.custom-gcl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: v2.1.0
1+
version: v2.7.0
22
name: golangci-lint-kube-api-linter
33
destination: ./bin
44
plugins:

pkg/cloud/converters/eks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ func NodegroupUpdateconfigToSDK(updateConfig *expinfrav1.UpdateConfig) (*ekstype
189189

190190
converted := &ekstypes.NodegroupUpdateConfig{}
191191
if updateConfig.MaxUnavailable != nil {
192-
//nolint:gosec,G115 // Added golint exception as there is a kubebuilder validation configured
192+
//nolint:G115 // Added golint exception as there is a kubebuilder validation configured
193193
converted.MaxUnavailable = aws.Int32(int32(*updateConfig.MaxUnavailable))
194194
}
195195
if updateConfig.MaxUnavailablePercentage != nil {
196-
//nolint:gosec,G115 // Added golint exception as there is a kubebuilder validation configured
196+
//nolint:G115 // Added golint exception as there is a kubebuilder validation configured
197197
converted.MaxUnavailablePercentage = aws.Int32(int32(*updateConfig.MaxUnavailablePercentage))
198198
}
199199

pkg/cloud/scope/cluster.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ func (s *ClusterScope) ControlPlaneLoadBalancers() []*infrav1.AWSLoadBalancerSpe
209209
}
210210

211211
// ControlPlaneLoadBalancerScheme returns the Classic ELB scheme (public or internal facing).
212+
//
212213
// Deprecated: This method is going to be removed in a future release. Use LoadBalancer.Scheme.
213214
func (s *ClusterScope) ControlPlaneLoadBalancerScheme() infrav1.ELBScheme {
214215
if s.ControlPlaneLoadBalancer() != nil && s.ControlPlaneLoadBalancer().Scheme != nil {

pkg/cloud/scope/elb.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ type ELBScope interface {
3939
VPC() *infrav1.VPCSpec
4040

4141
// ControlPlaneLoadBalancer returns the AWSLoadBalancerSpec
42+
//
4243
// Deprecated: Use ControlPlaneLoadBalancers()
4344
ControlPlaneLoadBalancer() *infrav1.AWSLoadBalancerSpec
4445

4546
// ControlPlaneLoadBalancerScheme returns the Classic ELB scheme (public or internal facing)
47+
//
4648
// Deprecated: This method is going to be removed in a future release. Use LoadBalancer.Scheme.
4749
ControlPlaneLoadBalancerScheme() infrav1.ELBScheme
4850

pkg/cloud/scope/sg.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type SGScope interface {
4444
Bastion() *infrav1.Bastion
4545

4646
// ControlPlaneLoadBalancer returns the load balancer settings that are requested.
47+
//
4748
// Deprecated: Use ControlPlaneLoadBalancers()
4849
ControlPlaneLoadBalancer() *infrav1.AWSLoadBalancerSpec
4950

pkg/cloud/services/ec2/dedicatedhosts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (s *Service) convertToHostInfo(host types.Host) *infrav1.DedicatedHostInfo
223223
instanceCount = math.MaxInt32
224224
}
225225
// bounds check ensures instanceCount <= math.MaxInt32, preventing integer overflow
226-
usedCapacity := int32(instanceCount) //nolint:gosec
226+
usedCapacity := int32(instanceCount)
227227
hostInfo.AvailableCapacity = hostInfo.TotalCapacity - usedCapacity
228228

229229
// Convert tags

pkg/cloud/services/ec2/instances.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ func (s *Service) runInstance(role string, i *infrav1.Instance) (*infrav1.Instan
594594
for index, id := range i.NetworkInterfaces {
595595
netInterfaces = append(netInterfaces, types.InstanceNetworkInterfaceSpecification{
596596
NetworkInterfaceId: aws.String(id),
597-
DeviceIndex: aws.Int32(int32(index)), //nolint:gosec // disable G115
597+
DeviceIndex: aws.Int32(int32(index)),
598598
})
599599
}
600600
netInterfaces[0].AssociatePublicIpAddress = i.PublicIPOnLaunch

0 commit comments

Comments
 (0)