Commit 34446f94 authored by David Sauer's avatar David Sauer
Browse files

Allow to disable tainting during pending node reboot by setting the taint name to an empty string.

parent 10d95c42
......@@ -88,7 +88,7 @@ func main() {
rootCmd.PersistentFlags().StringVar(&rebootSentinel, "reboot-sentinel", "/var/run/reboot-required",
"path to file whose existence signals need to reboot")
rootCmd.PersistentFlags().StringVar(&preferNoScheduleTaintName, "prefer-no-schedule-taint", "weave.works/kured-node-reboot",
"taint name applied during pending node reboot (to prevent receiving additional pods from other rebooting nodes)")
"Taint name applied during pending node reboot (to prevent receiving additional pods from other rebooting nodes). Set to \"\" to disable tainting.")
rootCmd.PersistentFlags().StringVar(&slackHookURL, "slack-hook-url", "",
"slack hook URL for reboot notfications")
......
......@@ -32,11 +32,19 @@ func New(client *kubernetes.Clientset, nodeID, taintName string, effect v1.Taint
// Enable creates the taint for a node. Creating an existing taint is a noop.
func (t *Taint) Enable() {
if t.taintName == "" {
return
}
preferNoSchedule(t.client, t.nodeID, t.taintName, t.effect, true)
}
// Disable removes the taint for a node. Removing a missing taint is a noop.
func (t *Taint) Disable() {
if t.taintName == "" {
return
}
preferNoSchedule(t.client, t.nodeID, t.taintName, t.effect, false)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment