Replace node's alpha taint key with GA

This commit is contained in:
Harry Zhang
2017-11-01 14:39:20 +08:00
parent a82460d772
commit df8c92ac12
3 changed files with 173 additions and 6 deletions

View File

@@ -454,25 +454,31 @@ func (nc *Controller) doFixDeprecatedTaintKeyPass(node *v1.Node) error {
for _, taint := range node.Spec.Taints {
if taint.Key == algorithm.DeprecatedTaintNodeNotReady {
// delete old taint
tDel := taint
taintsToDel = append(taintsToDel, &tDel)
// add right taint
tAdd := taint
tAdd.Key = algorithm.TaintNodeNotReady
taintsToAdd = append(taintsToAdd, &tAdd)
}
glog.Warningf("Detected deprecated taint key: %v on node: %v, will substitute it with %v",
algorithm.DeprecatedTaintNodeNotReady, node.GetName(), algorithm.TaintNodeNotReady)
if taint.Key == algorithm.DeprecatedTaintNodeUnreachable {
tDel := taint
taintsToDel = append(taintsToDel, &tDel)
break
tAdd := taint
tAdd.Key = algorithm.TaintNodeUnreachable
taintsToAdd = append(taintsToAdd, &tAdd)
}
}
if len(taintsToAdd) == 0 && len(taintsToDel) == 0 {
return nil
}
glog.Warningf("Detected deprecated taint keys: %v on node: %v, will substitute them with %v",
taintsToDel, node.GetName(), taintsToAdd)
if !util.SwapNodeControllerTaint(nc.kubeClient, taintsToAdd, taintsToDel, node) {
return fmt.Errorf("failed to swap taints of node %+v", node)
}