Merge pull request #104011 from manugupt1/master

fix: 81134: display conflicted taint without a json representation
This commit is contained in:
Kubernetes Prow Robot 2021-08-05 08:18:11 -07:00 committed by GitHub
commit 94a55684a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -248,7 +248,7 @@ func (o TaintOptions) Validate() error {
continue
}
if len(taintRemove.Effect) == 0 || taintAdd.Effect == taintRemove.Effect {
conflictTaint := fmt.Sprintf("{\"%s\":\"%s\"}", taintRemove.Key, taintRemove.Effect)
conflictTaint := fmt.Sprintf("%s=%s", taintRemove.Key, taintRemove.Effect)
conflictTaints = append(conflictTaints, conflictTaint)
}
}

View File

@ -216,6 +216,12 @@ func TestTaint(t *testing.T) {
expectFatal: true,
expectTaint: false,
},
{
description: "add and remove taint with same key and effect should be rejected",
args: []string{"node", "node-name", "foo=:NoExcute", "foo=:NoExcute-"},
expectFatal: true,
expectTaint: false,
},
{
description: "can't update existing taint on the node, since 'overwrite' flag is not set",
oldTaints: []corev1.Taint{{