Skip to content

Commit 1fb7cb7

Browse files
committed
Merge branch 'main' into cespo/eks-provisioned-control-plane
2 parents be24f76 + b914795 commit 1fb7cb7

File tree

20 files changed

+104
-20
lines changed

20 files changed

+104
-20
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

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ spec:
8080
arn:
8181
description: |-
8282
ARN of resource.
83+
8384
Deprecated: This field has no function and is going to be removed in the next release.
8485
type: string
8586
filters:
@@ -344,6 +345,7 @@ spec:
344345
arn:
345346
description: |-
346347
ARN of resource.
348+
347349
Deprecated: This field has no function and is going to be removed in the next release.
348350
type: string
349351
filters:

config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ spec:
9191
arn:
9292
description: |-
9393
ARN of resource.
94+
9495
Deprecated: This field has no function and is going to be removed in the next release.
9596
type: string
9697
filters:
@@ -360,6 +361,7 @@ spec:
360361
arn:
361362
description: |-
362363
ARN of resource.
364+
363365
Deprecated: This field has no function and is going to be removed in the next release.
364366
type: string
365367
filters:

controllers/awsmachine_annotations.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package controllers
1818

1919
import (
2020
"encoding/json"
21+
"maps"
2122

2223
infrav1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
2324
)
@@ -40,13 +41,14 @@ func (r *AWSMachineReconciler) updateMachineAnnotationJSON(machine *infrav1.AWSM
4041
// `content`.
4142
func (r *AWSMachineReconciler) updateMachineAnnotation(machine *infrav1.AWSMachine, annotation, content string) {
4243
// Get the annotations
43-
annotations := machine.GetAnnotations()
44+
annotations := maps.Clone(machine.GetAnnotations())
4445

45-
// Set our annotation to the given content.
46-
if annotations != nil {
47-
annotations[annotation] = content
46+
if annotations == nil {
47+
annotations = map[string]string{}
4848
}
4949

50+
annotations[annotation] = content
51+
5052
// Update the machine object with these annotations
5153
machine.SetAnnotations(annotations)
5254
}

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

0 commit comments

Comments
 (0)