Skip to content

Commit 30f5314

Browse files
committed
make lint-fix + manual lint fixes
1 parent 934c0ac commit 30f5314

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ linters:
2121
- durationcheck
2222
- errcheck
2323
- errchkjson
24-
- exportloopref
2524
- gci
2625
- ginkgolinter
2726
- goconst

controllers/vspherecluster_reconciler.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,7 @@ func (r *clusterReconciler) controlPlaneMachineToCluster(ctx context.Context, o
443443
}
444444

445445
return []ctrl.Request{{
446-
NamespacedName: types.NamespacedName{
447-
Namespace: vsphereClusterKey.Namespace,
448-
Name: vsphereClusterKey.Name,
449-
},
446+
NamespacedName: vsphereClusterKey,
450447
}}
451448
}
452449

controllers/vspherecluster_reconciler_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
119119
// Make sure the VSphereCluster exists.
120120
Eventually(func() error {
121121
return testEnv.Get(ctx, key, instance)
122-
}, timeout).Should(BeNil())
122+
}, timeout).Should(Succeed())
123123

124124
By("setting the OwnerRef on the VSphereCluster")
125125
Eventually(func() error {
@@ -132,7 +132,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
132132
UID: "blah",
133133
})
134134
return ph.Patch(ctx, instance, patch.WithStatusObservedGeneration{})
135-
}, timeout).Should(BeNil())
135+
}, timeout).Should(Succeed())
136136

137137
Eventually(func() bool {
138138
if err := testEnv.Get(ctx, key, instance); err != nil {
@@ -395,7 +395,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
395395
Expect(err).ShouldNot(HaveOccurred())
396396
zoneOne.Status.Ready = ptr.To(true)
397397
return ph.Patch(ctx, zoneOne, patch.WithStatusObservedGeneration{})
398-
}, timeout).Should(BeNil())
398+
}, timeout).Should(Succeed())
399399

400400
Eventually(func() bool {
401401
if err := testEnv.Get(ctx, key, instance); err != nil {
@@ -414,7 +414,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
414414
Expect(err).ShouldNot(HaveOccurred())
415415
zoneOne.Status.Ready = ptr.To(true)
416416
return ph.Patch(ctx, zoneOne, patch.WithStatusObservedGeneration{})
417-
}, timeout).Should(BeNil())
417+
}, timeout).Should(Succeed())
418418
})
419419

420420
It("should remove the FailureDomainsAvailable condition from the cluster", func() {

controllers/vspheremachine_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ var _ = Describe("VsphereMachineReconciler", func() {
166166
Expect(err).ShouldNot(HaveOccurred())
167167
capiCluster.Status.InfrastructureReady = true
168168
return ph.Patch(ctx, capiCluster, patch.WithStatusObservedGeneration{})
169-
}, timeout).Should(BeNil())
169+
}, timeout).Should(Succeed())
170170

171171
Eventually(func() bool {
172172
return isPresentAndFalseWithReason(infraMachine, infrav1.VMProvisionedCondition, infrav1.WaitingForClusterInfrastructureReason)
@@ -199,7 +199,7 @@ var _ = Describe("VsphereMachineReconciler", func() {
199199
DataSecretName: ptr.To("some-secret"),
200200
}
201201
return ph.Patch(ctx, capiMachine, patch.WithStatusObservedGeneration{})
202-
}, timeout).Should(BeNil())
202+
}, timeout).Should(Succeed())
203203

204204
Eventually(func() int {
205205
vms := infrav1.VSphereVMList{}

pkg/services/govmomi/ipam/status_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func Test_buildIPAMDeviceConfigs(t *testing.T) {
218218
// The IPAddressClaimed condition should not be added
219219
config, err := buildIPAMDeviceConfigs(ctx, vmCtx, networkStatus)
220220
g.Expect(err).NotTo(gomega.HaveOccurred())
221-
g.Expect(config[0].IPAMAddresses).To(gomega.HaveLen(0))
221+
g.Expect(config[0].IPAMAddresses).To(gomega.BeEmpty())
222222
})
223223
}
224224

@@ -435,7 +435,7 @@ func Test_BuildState(t *testing.T) {
435435

436436
state, err := BuildState(ctx, vmCtx, networkStatus)
437437
g.Expect(err).NotTo(gomega.HaveOccurred())
438-
g.Expect(state).To(gomega.HaveLen(0))
438+
g.Expect(state).To(gomega.BeEmpty())
439439
})
440440

441441
t.Run("when one device has no pool and is DHCP true, and one device has a IPAddressPool", func(_ *testing.T) {

test/e2e/multivc_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ func VerifyMultiVC(ctx context.Context, input MultiVCenterSpecInput) {
138138
Consistently(func() error {
139139
kubeSystem := &corev1.Namespace{}
140140
return input.Global.BootstrapClusterProxy.GetClient().Get(ctx, client.ObjectKey{Name: "kube-system"}, kubeSystem)
141-
}, "5s", "100ms").Should(BeNil(), "Failed to assert bootstrap API server stability")
141+
}, "5s", "100ms").Should(Succeed(), "Failed to assert bootstrap API server stability")
142142
Consistently(func() error {
143143
kubeSystem := &corev1.Namespace{}
144144
return mgmtClusterProxy.GetClient().Get(ctx, client.ObjectKey{Name: "kube-system"}, kubeSystem)
145-
}, "5s", "100ms").Should(BeNil(), "Failed to assert self-hosted API server stability")
145+
}, "5s", "100ms").Should(Succeed(), "Failed to assert self-hosted API server stability")
146146

147147
// Get the machines of the workloadCluster before it is moved to become self-hosted to make sure that the move did not trigger
148148
// any unexpected rollouts.

0 commit comments

Comments
 (0)