Skip to content

Commit 824e59c

Browse files
authored
Merge pull request #5255 from AndiDog/test-golangci-lint
🌱 Bump golangci-lint to v1.62.2 and fix all lint errors
2 parents 3effec8 + 090ab3c commit 824e59c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+167
-151
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
- name: golangci-lint
2929
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # tag=v6.1.1
3030
with:
31-
version: v1.56.1
31+
version: v1.62.2
3232
args: --out-format=colored-line-number
3333
working-directory: ${{matrix.working-directory}}

.golangci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ linters:
66
- bidichk
77
- bodyclose
88
- containedctx
9+
- copyloopvar
910
- dogsled
1011
- dupword
1112
- durationcheck
1213
- errcheck
1314
- errchkjson
14-
- exportloopref
1515
- gci
1616
- ginkgolinter
1717
- goconst
@@ -23,8 +23,10 @@ linters:
2323
- gosec
2424
- gosimple
2525
- govet
26+
- iface
2627
- importas
2728
- ineffassign
29+
- intrange
2830
- loggercheck
2931
- misspell
3032
- nakedret

bootstrap/eks/controllers/eksconfig_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1
231231
files, err := r.resolveFiles(ctx, config)
232232
if err != nil {
233233
log.Info("Failed to resolve files for user data")
234-
conditions.MarkFalse(config, eksbootstrapv1.DataSecretAvailableCondition, eksbootstrapv1.DataSecretGenerationFailedReason, clusterv1.ConditionSeverityWarning, err.Error())
234+
conditions.MarkFalse(config, eksbootstrapv1.DataSecretAvailableCondition, eksbootstrapv1.DataSecretGenerationFailedReason, clusterv1.ConditionSeverityWarning, "%s", err.Error())
235235
return err
236236
}
237237

bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ func TestEKSConfigReconciler(t *testing.T) {
5454
reconciler := EKSConfigReconciler{
5555
Client: testEnv.Client,
5656
}
57-
t.Logf(fmt.Sprintf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name))
57+
t.Logf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name)
5858
g.Eventually(func(gomega Gomega) {
5959
err := reconciler.joinWorker(ctx, cluster, config, configOwner("Machine"))
6060
gomega.Expect(err).NotTo(HaveOccurred())
6161
}).Should(Succeed())
6262

63-
t.Logf(fmt.Sprintf("Secret '%s' should exist and be correct", config.Name))
63+
t.Logf("Secret '%s' should exist and be correct", config.Name)
6464
secretList := &corev1.SecretList{}
6565
testEnv.Client.List(ctx, secretList)
66-
t.Logf(dump("secrets", secretList))
66+
t.Log(dump("secrets", secretList))
6767
secret := &corev1.Secret{}
6868
g.Eventually(func(gomega Gomega) {
6969
gomega.Expect(testEnv.Client.Get(ctx, client.ObjectKey{
@@ -91,10 +91,10 @@ func TestEKSConfigReconciler(t *testing.T) {
9191
},
9292
}
9393
config.Status.DataSecretName = &mp.Name
94-
t.Logf(dump("amcp", amcp))
95-
t.Logf(dump("config", config))
96-
t.Logf(dump("machinepool", mp))
97-
t.Logf(dump("cluster", cluster))
94+
t.Log(dump("amcp", amcp))
95+
t.Log(dump("config", config))
96+
t.Log(dump("machinepool", mp))
97+
t.Log(dump("cluster", cluster))
9898
oldUserData, err := newUserData(cluster.Name, map[string]string{"test-arg": "test-value"})
9999
g.Expect(err).To(BeNil())
100100
expectedUserData, err := newUserData(cluster.Name, map[string]string{"test-arg": "updated-test-value"})
@@ -103,21 +103,21 @@ func TestEKSConfigReconciler(t *testing.T) {
103103

104104
amcpList := &ekscontrolplanev1.AWSManagedControlPlaneList{}
105105
testEnv.Client.List(ctx, amcpList)
106-
t.Logf(dump("stored-amcps", amcpList))
106+
t.Log(dump("stored-amcps", amcpList))
107107

108108
reconciler := EKSConfigReconciler{
109109
Client: testEnv.Client,
110110
}
111-
t.Logf(fmt.Sprintf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name))
111+
t.Logf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name)
112112
g.Eventually(func(gomega Gomega) {
113113
err := reconciler.joinWorker(ctx, cluster, config, configOwner("MachinePool"))
114114
gomega.Expect(err).NotTo(HaveOccurred())
115115
}).Should(Succeed())
116116

117-
t.Logf(fmt.Sprintf("Secret '%s' should exist and be correct", config.Name))
117+
t.Logf("Secret '%s' should exist and be correct", config.Name)
118118
secretList := &corev1.SecretList{}
119119
testEnv.Client.List(ctx, secretList)
120-
t.Logf(dump("secrets", secretList))
120+
t.Log(dump("secrets", secretList))
121121

122122
secret := &corev1.Secret{}
123123
g.Eventually(func(gomega Gomega) {
@@ -132,15 +132,15 @@ func TestEKSConfigReconciler(t *testing.T) {
132132
config.Spec.KubeletExtraArgs = map[string]string{
133133
"test-arg": "updated-test-value",
134134
}
135-
t.Logf(dump("config", config))
135+
t.Log(dump("config", config))
136136
g.Eventually(func(gomega Gomega) {
137137
err := reconciler.joinWorker(ctx, cluster, config, configOwner("MachinePool"))
138138
gomega.Expect(err).NotTo(HaveOccurred())
139139
}).Should(Succeed())
140-
t.Logf(fmt.Sprintf("Secret '%s' should exist and be up to date", config.Name))
140+
t.Logf("Secret '%s' should exist and be up to date", config.Name)
141141

142142
testEnv.Client.List(ctx, secretList)
143-
t.Logf(dump("secrets", secretList))
143+
t.Log(dump("secrets", secretList))
144144
g.Eventually(func(gomega Gomega) {
145145
gomega.Expect(testEnv.Client.Get(ctx, client.ObjectKey{
146146
Name: config.Name,
@@ -156,10 +156,10 @@ func TestEKSConfigReconciler(t *testing.T) {
156156
cluster := newCluster(amcp.Name)
157157
machine := newMachine(cluster, "test-machine")
158158
config := newEKSConfig(machine)
159-
t.Logf(dump("amcp", amcp))
160-
t.Logf(dump("config", config))
161-
t.Logf(dump("machine", machine))
162-
t.Logf(dump("cluster", cluster))
159+
t.Log(dump("amcp", amcp))
160+
t.Log(dump("config", config))
161+
t.Log(dump("machine", machine))
162+
t.Log(dump("cluster", cluster))
163163
expectedUserData, err := newUserData(cluster.Name, map[string]string{"test-arg": "test-value"})
164164
g.Expect(err).To(BeNil())
165165
g.Expect(testEnv.Client.Create(ctx, amcp)).To(Succeed())
@@ -174,21 +174,21 @@ func TestEKSConfigReconciler(t *testing.T) {
174174

175175
amcpList := &ekscontrolplanev1.AWSManagedControlPlaneList{}
176176
testEnv.Client.List(ctx, amcpList)
177-
t.Logf(dump("stored-amcps", amcpList))
177+
t.Log(dump("stored-amcps", amcpList))
178178

179179
reconciler := EKSConfigReconciler{
180180
Client: testEnv.Client,
181181
}
182-
t.Logf(fmt.Sprintf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name))
182+
t.Logf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name)
183183
g.Eventually(func(gomega Gomega) {
184184
err := reconciler.joinWorker(ctx, cluster, config, configOwner("Machine"))
185185
gomega.Expect(err).NotTo(HaveOccurred())
186186
}).Should(Succeed())
187187

188-
t.Logf(fmt.Sprintf("Secret '%s' should exist and be out of date", config.Name))
188+
t.Logf("Secret '%s' should exist and be out of date", config.Name)
189189
secretList := &corev1.SecretList{}
190190
testEnv.Client.List(ctx, secretList)
191-
t.Logf(dump("secrets", secretList))
191+
t.Log(dump("secrets", secretList))
192192

193193
secret = &corev1.Secret{}
194194
g.Eventually(func(gomega Gomega) {
@@ -226,11 +226,11 @@ func TestEKSConfigReconciler(t *testing.T) {
226226
"secretKey": []byte(secretContent),
227227
},
228228
}
229-
t.Logf(dump("amcp", amcp))
230-
t.Logf(dump("config", config))
231-
t.Logf(dump("machine", machine))
232-
t.Logf(dump("cluster", cluster))
233-
t.Logf(dump("secret", secret))
229+
t.Log(dump("amcp", amcp))
230+
t.Log(dump("config", config))
231+
t.Log(dump("machine", machine))
232+
t.Log(dump("cluster", cluster))
233+
t.Log(dump("secret", secret))
234234
g.Expect(testEnv.Client.Create(ctx, secret)).To(Succeed())
235235
g.Expect(testEnv.Client.Create(ctx, amcp)).To(Succeed())
236236

@@ -252,15 +252,15 @@ func TestEKSConfigReconciler(t *testing.T) {
252252
reconciler := EKSConfigReconciler{
253253
Client: testEnv.Client,
254254
}
255-
t.Logf(fmt.Sprintf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name))
255+
t.Logf("Calling reconcile on cluster '%s' and config '%s' should requeue", cluster.Name, config.Name)
256256
g.Eventually(func(gomega Gomega) {
257257
err := reconciler.joinWorker(ctx, cluster, config, configOwner("Machine"))
258258
gomega.Expect(err).NotTo(HaveOccurred())
259259
}).Should(Succeed())
260260

261261
secretList := &corev1.SecretList{}
262262
testEnv.Client.List(ctx, secretList)
263-
t.Logf(dump("secrets", secretList))
263+
t.Log(dump("secrets", secretList))
264264
gotSecret := &corev1.Secret{}
265265
g.Eventually(func(gomega Gomega) {
266266
gomega.Expect(testEnv.Client.Get(ctx, client.ObjectKey{

cmd/clusterawsadm/ami/helper.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func LatestPatchRelease(searchVersion string) (string, error) {
6767
if err != nil {
6868
return "", err
6969
}
70+
//#nosec G115
7071
resp, err := http.Get(fmt.Sprintf(latestStableReleaseURL, "-"+strconv.Itoa(int(searchSemVer.Major))+"."+strconv.Itoa(int(searchSemVer.Minor))))
7172
if err != nil {
7273
return "", err

cmd/clusterawsadm/cloudformation/bootstrap/template_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package bootstrap
1818

1919
import (
2020
"bytes"
21-
"fmt"
2221
"os"
2322
"path"
2423
"testing"
@@ -206,7 +205,7 @@ func TestRenderCloudformation(t *testing.T) {
206205
dmp := diffmatchpatch.New()
207206
diffs := dmp.DiffMain(string(tData), string(data), false)
208207
out := dmp.DiffPrettyText(diffs)
209-
t.Fatalf(fmt.Sprintf("Differing output (%s):\n%s", c.fixture, out))
208+
t.Fatalf("Differing output (%s):\n%s", c.fixture, out)
210209
}
211210
})
212211
}

controllers/awscluster_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func (r *AWSClusterReconciler) reconcileLoadBalancer(clusterScope *scope.Cluster
277277

278278
if err := elbService.ReconcileLoadbalancers(); err != nil {
279279
clusterScope.Error(err, "failed to reconcile load balancer")
280-
conditions.MarkFalse(awsCluster, infrav1.LoadBalancerReadyCondition, infrav1.LoadBalancerFailedReason, infrautilconditions.ErrorConditionAfterInit(clusterScope.ClusterObj()), err.Error())
280+
conditions.MarkFalse(awsCluster, infrav1.LoadBalancerReadyCondition, infrav1.LoadBalancerFailedReason, infrautilconditions.ErrorConditionAfterInit(clusterScope.ClusterObj()), "%s", err.Error())
281281
return nil, err
282282
}
283283

@@ -322,12 +322,12 @@ func (r *AWSClusterReconciler) reconcileNormal(clusterScope *scope.ClusterScope)
322322

323323
if err := sgService.ReconcileSecurityGroups(); err != nil {
324324
clusterScope.Error(err, "failed to reconcile security groups")
325-
conditions.MarkFalse(awsCluster, infrav1.ClusterSecurityGroupsReadyCondition, infrav1.ClusterSecurityGroupReconciliationFailedReason, infrautilconditions.ErrorConditionAfterInit(clusterScope.ClusterObj()), err.Error())
325+
conditions.MarkFalse(awsCluster, infrav1.ClusterSecurityGroupsReadyCondition, infrav1.ClusterSecurityGroupReconciliationFailedReason, infrautilconditions.ErrorConditionAfterInit(clusterScope.ClusterObj()), "%s", err.Error())
326326
return reconcile.Result{}, err
327327
}
328328

329329
if err := ec2Service.ReconcileBastion(); err != nil {
330-
conditions.MarkFalse(awsCluster, infrav1.BastionHostReadyCondition, infrav1.BastionHostFailedReason, infrautilconditions.ErrorConditionAfterInit(clusterScope.ClusterObj()), err.Error())
330+
conditions.MarkFalse(awsCluster, infrav1.BastionHostReadyCondition, infrav1.BastionHostFailedReason, infrautilconditions.ErrorConditionAfterInit(clusterScope.ClusterObj()), "%s", err.Error())
331331
clusterScope.Error(err, "failed to reconcile bastion host")
332332
return reconcile.Result{}, err
333333
}
@@ -347,7 +347,7 @@ func (r *AWSClusterReconciler) reconcileNormal(clusterScope *scope.ClusterScope)
347347
}
348348

349349
if err := s3Service.ReconcileBucket(); err != nil {
350-
conditions.MarkFalse(awsCluster, infrav1.S3BucketReadyCondition, infrav1.S3BucketFailedReason, clusterv1.ConditionSeverityError, err.Error())
350+
conditions.MarkFalse(awsCluster, infrav1.S3BucketReadyCondition, infrav1.S3BucketFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
351351
return reconcile.Result{}, errors.Wrapf(err, "failed to reconcile S3 Bucket for AWSCluster %s/%s", awsCluster.Namespace, awsCluster.Name)
352352
}
353353
conditions.MarkTrue(awsCluster, infrav1.S3BucketReadyCondition)

controllers/awsmachine_controller.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ func (r *AWSMachineReconciler) reconcileDelete(machineScope *scope.MachineScope,
335335
// all the other errors are blocking.
336336
// Because we are reconciling all load balancers, attempt to treat the error as a list of errors.
337337
if err = kerrors.FilterOut(err, elb.IsAccessDenied, elb.IsNotFound); err != nil {
338-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, "DeletingFailed", clusterv1.ConditionSeverityWarning, err.Error())
338+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, "DeletingFailed", clusterv1.ConditionSeverityWarning, "%s", err.Error())
339339
return ctrl.Result{}, errors.Errorf("failed to reconcile LB attachment: %+v", err)
340340
}
341341
}
@@ -374,7 +374,7 @@ func (r *AWSMachineReconciler) reconcileDelete(machineScope *scope.MachineScope,
374374

375375
if err := ec2Service.TerminateInstance(instance.ID); err != nil {
376376
machineScope.Error(err, "failed to terminate instance")
377-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.InstanceReadyCondition, "DeletingFailed", clusterv1.ConditionSeverityWarning, err.Error())
377+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.InstanceReadyCondition, "DeletingFailed", clusterv1.ConditionSeverityWarning, "%s", err.Error())
378378
r.Recorder.Eventf(machineScope.AWSMachine, corev1.EventTypeWarning, "FailedTerminate", "Failed to terminate instance %q: %v", instance.ID, err)
379379
return ctrl.Result{}, err
380380
}
@@ -402,7 +402,7 @@ func (r *AWSMachineReconciler) reconcileDelete(machineScope *scope.MachineScope,
402402
for _, id := range machineScope.AWSMachine.Spec.NetworkInterfaces {
403403
if err := ec2Service.DetachSecurityGroupsFromNetworkInterface(core, id); err != nil {
404404
machineScope.Error(err, "failed to detach security groups from instance's network interfaces")
405-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.SecurityGroupsReadyCondition, "DeletingFailed", clusterv1.ConditionSeverityWarning, err.Error())
405+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.SecurityGroupsReadyCondition, "DeletingFailed", clusterv1.ConditionSeverityWarning, "%s", err.Error())
406406
return ctrl.Result{}, err
407407
}
408408
}
@@ -494,7 +494,7 @@ func (r *AWSMachineReconciler) reconcileNormal(_ context.Context, machineScope *
494494
instance, err := r.findInstance(machineScope, ec2svc)
495495
if err != nil {
496496
machineScope.Error(err, "unable to find instance")
497-
conditions.MarkUnknown(machineScope.AWSMachine, infrav1.InstanceReadyCondition, infrav1.InstanceNotFoundReason, err.Error())
497+
conditions.MarkUnknown(machineScope.AWSMachine, infrav1.InstanceReadyCondition, infrav1.InstanceNotFoundReason, "%s", err.Error())
498498
return ctrl.Result{}, err
499499
}
500500

@@ -527,7 +527,7 @@ func (r *AWSMachineReconciler) reconcileNormal(_ context.Context, machineScope *
527527
instance, err = r.createInstance(ec2svc, machineScope, clusterScope, objectStoreSvc)
528528
if err != nil {
529529
machineScope.Error(err, "unable to create instance")
530-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.InstanceReadyCondition, infrav1.InstanceProvisionFailedReason, clusterv1.ConditionSeverityError, err.Error())
530+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.InstanceReadyCondition, infrav1.InstanceProvisionFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
531531
return ctrl.Result{}, err
532532
}
533533
}
@@ -661,7 +661,7 @@ func (r *AWSMachineReconciler) reconcileOperationalState(ec2svc services.EC2Inte
661661
// Ensure that the security groups are correct.
662662
_, err = r.ensureSecurityGroups(ec2svc, machineScope, machineScope.AWSMachine.Spec.AdditionalSecurityGroups, existingSecurityGroups)
663663
if err != nil {
664-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.SecurityGroupsReadyCondition, infrav1.SecurityGroupsFailedReason, clusterv1.ConditionSeverityError, err.Error())
664+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.SecurityGroupsReadyCondition, infrav1.SecurityGroupsFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
665665
machineScope.Error(err, "unable to ensure security groups")
666666
return err
667667
}
@@ -990,7 +990,7 @@ func (r *AWSMachineReconciler) registerInstanceToClassicLB(machineScope *scope.M
990990
if err := elbsvc.RegisterInstanceWithAPIServerELB(i); err != nil {
991991
r.Recorder.Eventf(machineScope.AWSMachine, corev1.EventTypeWarning, "FailedAttachControlPlaneELB",
992992
"Failed to register control plane instance %q with classic load balancer: %v", i.ID, err)
993-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBAttachFailedReason, clusterv1.ConditionSeverityError, err.Error())
993+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBAttachFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
994994
return errors.Wrapf(err, "could not register control plane instance %q with classic load balancer", i.ID)
995995
}
996996
r.Recorder.Eventf(machineScope.AWSMachine, corev1.EventTypeNormal, "SuccessfulAttachControlPlaneELB",
@@ -1022,7 +1022,7 @@ func (r *AWSMachineReconciler) registerInstanceToV2LB(machineScope *scope.Machin
10221022
if err := elbsvc.RegisterInstanceWithAPIServerLB(instance, lb); err != nil {
10231023
r.Recorder.Eventf(machineScope.AWSMachine, corev1.EventTypeWarning, "FailedAttachControlPlaneELB",
10241024
"Failed to register control plane instance %q with load balancer: %v", instance.ID, err)
1025-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBAttachFailedReason, clusterv1.ConditionSeverityError, err.Error())
1025+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBAttachFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
10261026
return errors.Wrapf(err, "could not register control plane instance %q with load balancer", instance.ID)
10271027
}
10281028
r.Recorder.Eventf(machineScope.AWSMachine, corev1.EventTypeNormal, "SuccessfulAttachControlPlaneELB",
@@ -1046,7 +1046,7 @@ func (r *AWSMachineReconciler) deregisterInstanceFromClassicLB(machineScope *sco
10461046
if err := elbsvc.DeregisterInstanceFromAPIServerELB(instance); err != nil {
10471047
r.Recorder.Eventf(machineScope.AWSMachine, corev1.EventTypeWarning, "FailedDetachControlPlaneELB",
10481048
"Failed to deregister control plane instance %q from load balancer: %v", instance.ID, err)
1049-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBDetachFailedReason, clusterv1.ConditionSeverityError, err.Error())
1049+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBDetachFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
10501050
return errors.Wrapf(err, "could not deregister control plane instance %q from load balancer", instance.ID)
10511051
}
10521052

@@ -1071,7 +1071,7 @@ func (r *AWSMachineReconciler) deregisterInstanceFromV2LB(machineScope *scope.Ma
10711071
if err := elbsvc.DeregisterInstanceFromAPIServerLB(targetGroupArn, i); err != nil {
10721072
r.Recorder.Eventf(machineScope.AWSMachine, corev1.EventTypeWarning, "FailedDetachControlPlaneELB",
10731073
"Failed to deregister control plane instance %q from load balancer: %v", i.ID, err)
1074-
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBDetachFailedReason, clusterv1.ConditionSeverityError, err.Error())
1074+
conditions.MarkFalse(machineScope.AWSMachine, infrav1.ELBAttachedCondition, infrav1.ELBDetachFailedReason, clusterv1.ConditionSeverityError, "%s", err.Error())
10751075
return errors.Wrapf(err, "could not deregister control plane instance %q from load balancer", i.ID)
10761076
}
10771077
}
@@ -1141,7 +1141,6 @@ func (r *AWSMachineReconciler) requestsForCluster(log logger.Wrapper, namespace,
11411141

11421142
result := make([]ctrl.Request, 0, len(machineList.Items))
11431143
for _, m := range machineList.Items {
1144-
m := m
11451144
log.WithValues("machine", klog.KObj(&m))
11461145
if m.Spec.InfrastructureRef.GroupVersionKind().Kind != "AWSMachine" {
11471146
log.Trace("Machine has an InfrastructureRef for a different type, will not add to reconciliation request.")

0 commit comments

Comments
 (0)