daemon/update: Don't drain the node without cluster
@@ -48,6 +48,10 @@ func (dn *Daemon) update(oldConfig, newConfig *mcfgv1.MachineConfig) error {
return err
}
+ // TODO: Change the logic to be clearer
+ // We need to skip draining of the node when we are running once
+ // and there is no cluster.
+ if dn.onceFrom != "" && !ValidPath(dn.onceFrom) {
glog.Info("Update completed. Draining the node.")
node, err := dn.kubeClient.CoreV1().Nodes().Get(dn.name, metav1.GetOptions{})
@@ -65,7 +69,7 @@ func (dn *Daemon) update(oldConfig, newConfig *mcfgv1.MachineConfig) error {
return err
}
glog.V(2).Infof("Node successfully drained")
-
+ }
// reboot. this function shouldn't actually return.
return dn.reboot()
}
