Skip to content

Commit 988ff00

Browse files
committed
rebase fixes
1 parent 6b2c7e2 commit 988ff00

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

internal/controllers/machine/machine_controller_noderef.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (r *Reconciler) reconcileNode(ctx context.Context, s *scope) (ctrl.Result,
145145
_, nodeHadInterruptibleLabel := s.node.Labels[clusterv1.InterruptibleLabel]
146146

147147
// Reconcile node taints
148-
if err := r.patchNode(ctx, remoteClient, s.node, nodeLabels, nodeAnnotations, s.owningMachineSet, s.owningMachineDeployment); err != nil {
148+
if err := r.patchNode(ctx, remoteClient, s.node, nodeLabels, nodeAnnotations, machine, s.owningMachineSet, s.owningMachineDeployment); err != nil {
149149
return ctrl.Result{}, errors.Wrapf(err, "failed to reconcile Node %s", klog.KObj(s.node))
150150
}
151151
if !nodeHadInterruptibleLabel && interruptible {
@@ -248,7 +248,7 @@ func (r *Reconciler) getNode(ctx context.Context, c client.Reader, providerID st
248248

249249
// PatchNode is required to workaround an issue on Node.Status.Address which is incorrectly annotated as patchStrategy=merge
250250
// and this causes SSA patch to fail in case there are two addresses with the same key https://github.com/kubernetes-sigs/cluster-api/issues/8417
251-
func (r *Reconciler) patchNode(ctx context.Context, remoteClient client.Client, node *corev1.Node, newLabels, newAnnotations map[string]string, ms *clusterv1.MachineSet, md *clusterv1.MachineDeployment) error {
251+
func (r *Reconciler) patchNode(ctx context.Context, remoteClient client.Client, node *corev1.Node, newLabels, newAnnotations map[string]string, m *clusterv1.Machine, ms *clusterv1.MachineSet, md *clusterv1.MachineDeployment) error {
252252
newNode := node.DeepCopy()
253253

254254
// Adds the annotations from the Machine.

internal/controllers/machine/machine_controller_noderef_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ func TestPatchNode(t *testing.T) {
12991299
_ = env.CleanupAndWait(ctx, oldNode, machine, ms, md)
13001300
})
13011301

1302-
err := r.patchNode(ctx, env, oldNode, tc.newLabels, tc.newAnnotations, ms, md)
1302+
err := r.patchNode(ctx, env, oldNode, tc.newLabels, tc.newAnnotations, tc.machine, ms, md)
13031303
g.Expect(err).ToNot(HaveOccurred())
13041304

13051305
g.Eventually(func(g Gomega) {
@@ -1404,7 +1404,7 @@ func TestMultiplePatchNode(t *testing.T) {
14041404
_ = env.CleanupAndWait(ctx, oldNode, machine)
14051405
})
14061406

1407-
err := r.patchNode(ctx, env, oldNode, labels, tc.newAnnotations, nil, nil)
1407+
err := r.patchNode(ctx, env, oldNode, labels, tc.newAnnotations, machine, nil, nil)
14081408
g.Expect(err).ToNot(HaveOccurred())
14091409

14101410
newNode := &corev1.Node{}
@@ -1418,7 +1418,7 @@ func TestMultiplePatchNode(t *testing.T) {
14181418
}, 10*time.Second).Should(Succeed())
14191419

14201420
// Re-reconcile with the same metadata
1421-
err = r.patchNode(ctx, env, newNode, labels, tc.newAnnotations, nil, nil)
1421+
err = r.patchNode(ctx, env, newNode, labels, tc.newAnnotations, machine, nil, nil)
14221422
g.Expect(err).ToNot(HaveOccurred())
14231423

14241424
g.Eventually(func(g Gomega) {

0 commit comments

Comments
 (0)