Merge pull request #36994 from gmarek/taints

Automatic merge from submit-queue

Delete taint annotation when removing last taint

It messes with debugging of tests failures.

cc @davidopp @kevin-wangzefeng
This commit is contained in:
Kubernetes Submit Queue 2016-11-17 08:26:31 -08:00 committed by GitHub
commit 3ed6000c82

View File

@ -2587,10 +2587,14 @@ func RemoveTaintOffNode(c clientset.Interface, nodeName string, taint api.Taint)
newTaints, err := deleteTaint(nodeTaints, taint)
ExpectNoError(err)
if len(newTaints) == 0 {
delete(node.Annotations, api.TaintsAnnotationKey)
} else {
taintsData, err := json.Marshal(newTaints)
ExpectNoError(err)
node.Annotations[api.TaintsAnnotationKey] = string(taintsData)
}
taintsData, err := json.Marshal(newTaints)
ExpectNoError(err)
node.Annotations[api.TaintsAnnotationKey] = string(taintsData)
_, err = c.Core().Nodes().Update(node)
if err != nil {
if !apierrs.IsConflict(err) {