Skip to content

Commit 8d0c60f

Browse files
authored
Merge pull request #9099 from Anddd7/remove-disable-in-place-propagation
🌱 Remove disableInPlacePropagation field in KCP controller
2 parents 4a3e325 + e1360e7 commit 8d0c60f

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

controlplane/kubeadm/internal/controllers/controller.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ type KubeadmControlPlaneReconciler struct {
8585

8686
managementCluster internal.ManagementCluster
8787
managementClusterUncached internal.ManagementCluster
88-
89-
// disableInPlacePropagation should only be used for tests. This is used to skip
90-
// some parts of the controller that need SSA as the current test setup does not
91-
// support SSA. This flag should be dropped after all affected tests are migrated
92-
// to envtest.
93-
disableInPlacePropagation bool
9488
ssaCache ssa.Cache
9589
}
9690

@@ -375,10 +369,8 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, controlPl
375369
return result, err
376370
}
377371

378-
if !r.disableInPlacePropagation {
379-
if err := r.syncMachines(ctx, controlPlane); err != nil {
380-
return ctrl.Result{}, errors.Wrap(err, "failed to sync Machines")
381-
}
372+
if err := r.syncMachines(ctx, controlPlane); err != nil {
373+
return ctrl.Result{}, errors.Wrap(err, "failed to sync Machines")
382374
}
383375

384376
// Aggregate the operational state of all the machines; while aggregating we are adding the

controlplane/kubeadm/internal/controllers/controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ kubernetesVersion: metav1.16.1`,
13321332
Status: internal.ClusterStatus{},
13331333
},
13341334
},
1335-
disableInPlacePropagation: true,
1335+
ssaCache: ssa.NewCache(),
13361336
}
13371337

13381338
result, err := r.Reconcile(ctx, ctrl.Request{NamespacedName: util.ObjectKey(kcp)})

controlplane/kubeadm/internal/controllers/scale_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,13 @@ func TestKubeadmControlPlaneReconciler_scaleUpControlPlane(t *testing.T) {
213213
managementCluster: fmc,
214214
managementClusterUncached: fmc,
215215
recorder: record.NewFakeRecorder(32),
216-
disableInPlacePropagation: true,
217216
}
218217

219218
controlPlane, adoptableMachineFound, err := r.initControlPlaneScope(ctx, cluster, kcp)
220219
g.Expect(err).ToNot(HaveOccurred())
221220
g.Expect(adoptableMachineFound).To(BeFalse())
222221

223-
result, err := r.reconcile(context.Background(), controlPlane)
222+
result, err := r.scaleUpControlPlane(context.Background(), controlPlane)
224223
g.Expect(err).ToNot(HaveOccurred())
225224
g.Expect(result).To(Equal(ctrl.Result{RequeueAfter: preflightFailedRequeueAfter}))
226225

controlplane/kubeadm/internal/controllers/upgrade_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
3636
"sigs.k8s.io/cluster-api/controlplane/kubeadm/internal"
3737
"sigs.k8s.io/cluster-api/internal/test/builder"
38+
"sigs.k8s.io/cluster-api/internal/util/ssa"
3839
"sigs.k8s.io/cluster-api/util"
3940
"sigs.k8s.io/cluster-api/util/collections"
4041
)
@@ -93,7 +94,7 @@ func TestKubeadmControlPlaneReconciler_RolloutStrategy_ScaleUp(t *testing.T) {
9394
Status: internal.ClusterStatus{Nodes: 1},
9495
},
9596
},
96-
disableInPlacePropagation: true,
97+
ssaCache: ssa.NewCache(),
9798
}
9899
controlPlane := &internal.ControlPlane{
99100
KCP: kcp,

0 commit comments

Comments
 (0)