Skip to content

Commit f05ab60

Browse files
Fix linting issues
1 parent a06e362 commit f05ab60

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

api/v1beta1/condition_consts.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ const (
2424
ReadyCondition ConditionType = "Ready"
2525

2626
// PausedCondition defines the Paused condition type that summarizes the operational state of a Cluster API object.
27-
28-
// TODO: I've noticed we have controller specific conditions. I'm not sure if
29-
// I want to have a shared condition, or many controller specific conditions. 🤔
3027
PausedCondition ConditionType = "Paused"
3128
)
3229

controlplane/kubeadm/internal/controllers/controller_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,6 @@ func TestReconcilePausedCondition(t *testing.T) {
23782378
// The condition is set to true
23792379
return conditions.IsTrue(kcp, clusterv1.PausedCondition)
23802380
}, timeout).Should(BeTrue())
2381-
23822381
}
23832382

23842383
// test utils.

internal/controllers/machine/machine_controller_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,8 +2643,7 @@ func TestPauseConditionReconcile(t *testing.T) {
26432643
g.Expect(unstructured.SetNestedField(infraMachine.Object, true, "status", "ready")).To(Succeed())
26442644
g.Expect(env.Status().Patch(ctx, infraMachine, infraMachinePatch)).To(Succeed())
26452645

2646-
// The cluster starts paused, so the machine machine should have a Paused:
2647-
// true condition
2646+
// Cluster starts paused, so the machine should have a Paused: true condition
26482647
g.Eventually(func() bool {
26492648
if err := env.Get(ctx, key, machine); err != nil {
26502649
return false

util/predicates/cluster_predicates.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ func ClusterUnpaused(logger logr.Logger) predicate.Funcs {
168168
return Any(log, ClusterCreateNotPaused(log), ClusterUpdateUnpaused(log))
169169
}
170170

171+
// ClusterCreateUpdateEvent returns a predicate that returns true on any cluster creation event, or any update event where the cluster is paused or unpaused. This is to allow updating of paused conditions on CAPI objects.
172+
// TODO: Look and see if there's a better way to do this. I'm pretty sure there is.
171173
func ClusterCreateUpdateEvent(logger logr.Logger) predicate.Funcs {
172174
return predicate.Funcs{
173175
UpdateFunc: func(e event.UpdateEvent) bool {
@@ -203,7 +205,8 @@ func ClusterCreateUpdateEvent(logger logr.Logger) predicate.Funcs {
203205
return false
204206
}
205207
log = log.WithValues("Cluster", klog.KObj(c))
206-
208+
log.V(4).Info(`Cluster created, allowing further processing regardless of
209+
.spec.paused to update conditions`)
207210
return true
208211
},
209212
DeleteFunc: func(event.DeleteEvent) bool { return false },

0 commit comments

Comments
 (0)