Merge pull request #30590 from kevin-wangzefeng/taint-unique-by-key-effect

Automatic merge from submit-queue

make taints unique by <key, effect> on a node

closes #29362
This commit is contained in:
Kubernetes Submit Queue
2016-08-19 04:58:12 -07:00
committed by GitHub
6 changed files with 191 additions and 57 deletions

View File

@@ -2546,15 +2546,19 @@ func printTaintsMultilineWithIndent(out io.Writer, initialIndent, title, innerIn
}
sort.Strings(keys)
effects := []api.TaintEffect{api.TaintEffectNoSchedule, api.TaintEffectPreferNoSchedule}
for i, key := range keys {
for _, taint := range taints {
if taint.Key == key {
if i != 0 {
fmt.Fprint(out, initialIndent)
fmt.Fprint(out, innerIndent)
for _, effect := range effects {
for _, taint := range taints {
if taint.Key == key && taint.Effect == effect {
if i != 0 {
fmt.Fprint(out, initialIndent)
fmt.Fprint(out, innerIndent)
}
fmt.Fprintf(out, "%s=%s:%s\n", taint.Key, taint.Value, taint.Effect)
i++
}
fmt.Fprintf(out, "%s=%s:%s\n", taint.Key, taint.Value, taint.Effect)
i++
}
}
}