make kubectl respect taint effect NoExecute
This commit is contained in:
@@ -43,7 +43,7 @@ func ParseTaint(st string) (v1.Taint, error) {
|
||||
return taint, fmt.Errorf("invalid taint spec: %v, %s", st, strings.Join(errs, "; "))
|
||||
}
|
||||
|
||||
if effect != v1.TaintEffectNoSchedule && effect != v1.TaintEffectPreferNoSchedule {
|
||||
if effect != v1.TaintEffectNoSchedule && effect != v1.TaintEffectPreferNoSchedule && effect != v1.TaintEffectNoExecute {
|
||||
return taint, fmt.Errorf("invalid taint spec: %v, unsupported taint effect", st)
|
||||
}
|
||||
|
||||
|
@@ -47,6 +47,10 @@ func TestTaintsVar(t *testing.T) {
|
||||
{Key: "bing", Value: "bang", Effect: api.TaintEffectPreferNoSchedule},
|
||||
},
|
||||
},
|
||||
{
|
||||
f: "--t=dedicated-for=user1:NoExecute",
|
||||
t: []api.Taint{{Key: "dedicated-for", Value: "user1", Effect: "NoExecute"}},
|
||||
},
|
||||
}
|
||||
|
||||
for i, c := range cases {
|
||||
|
Reference in New Issue
Block a user