mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
update taints e2e, respect that taint is unique by key, effect
This commit is contained in:
@@ -144,7 +144,7 @@ func reorganizeTaints(accessor meta.Object, overwrite bool, taintsToAdd []api.Ta
|
||||
for _, oldTaint := range oldTaints {
|
||||
existsInNew := false
|
||||
for _, taint := range newTaints {
|
||||
if taint.Key == oldTaint.Key && taint.Effect == oldTaint.Effect {
|
||||
if taint.MatchTaint(oldTaint) {
|
||||
existsInNew = true
|
||||
break
|
||||
}
|
||||
|
||||
@@ -2579,23 +2579,19 @@ func printTaintsMultilineWithIndent(out io.Writer, initialIndent, title, innerIn
|
||||
// to print taints in the sorted order
|
||||
keys := make([]string, 0, len(taints))
|
||||
for _, taint := range taints {
|
||||
keys = append(keys, taint.Key)
|
||||
keys = append(keys, string(taint.Effect)+","+taint.Key)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
effects := []api.TaintEffect{api.TaintEffectNoSchedule, api.TaintEffectPreferNoSchedule}
|
||||
|
||||
for i, key := range keys {
|
||||
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++
|
||||
for _, taint := range taints {
|
||||
if string(taint.Effect)+","+taint.Key == key {
|
||||
if i != 0 {
|
||||
fmt.Fprint(out, initialIndent)
|
||||
fmt.Fprint(out, innerIndent)
|
||||
}
|
||||
fmt.Fprintf(out, "%s\n", taint.ToString())
|
||||
i++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user