Skip to content

Commit

Permalink
Add support for reconciles machine taints with nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
enxebre committed Dec 21, 2018
1 parent d19e6b6 commit 3d31285
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/controller/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,22 @@ func (c *ReconcileNode) link(node *corev1.Node) error {
machine.ObjectMeta.Name, node.ObjectMeta.Name)
c.linkedNodes[node.ObjectMeta.Name] = true
c.cachedReadiness[node.ObjectMeta.Name] = nodeReady
if err := c.reconcileTaintsWithNode(*machine); err != nil {
klog.Infof("failed to reconcile machine object %v taints with its node due to error %v.", machine.Name, err)
return err
}
}
return err
}

func (r *ReconcileNode) reconcileTaintsWithNode(machine v1alpha1.Machine) error {
if node := machine.Status.NodeRef; node != nil {
// TODO: sync taints logic and unit test
return r.Client.Update(context.Background(), node)
}
return nil
}

func (c *ReconcileNode) unlink(node *corev1.Node) error {
val, ok := node.ObjectMeta.Annotations[machineAnnotationKey]
if !ok {
Expand Down

0 comments on commit 3d31285

Please sign in to comment.