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

This commit is contained in:
David Sauer
2021-01-06 21:39:32 +01:00
parent 10d95c426f
commit 34446f949e
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -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)
}