Update tests to reflect that kubeadm taints should not override node taints

This commit is contained in:
Ashley 2018-06-14 10:57:34 -04:00
parent 792195eaa5
commit 35615881e3
No known key found for this signature in database
GPG Key ID: A1FDE6009238742A

View File

@ -82,11 +82,28 @@ func TestMarkMaster(t *testing.T) {
"{}",
},
{
"nothing missing but taint unwanted",
"has taint and no new taints wanted",
kubeadmconstants.LabelNodeRoleMaster,
[]v1.Taint{kubeadmconstants.MasterTaint},
[]v1.Taint{
{
Key: "node.cloudprovider.kubernetes.io/uninitialized",
Effect: v1.TaintEffectNoSchedule,
},
},
nil,
"{\"spec\":{\"taints\":null}}",
"{}",
},
{
"has taint and should merge with wanted taint",
kubeadmconstants.LabelNodeRoleMaster,
[]v1.Taint{
{
Key: "node.cloudprovider.kubernetes.io/uninitialized",
Effect: v1.TaintEffectNoSchedule,
},
},
[]v1.Taint{kubeadmconstants.MasterTaint},
"{\"spec\":{\"taints\":[{\"effect\":\"NoSchedule\",\"key\":\"node-role.kubernetes.io/master\"},{\"effect\":\"NoSchedule\",\"key\":\"node.cloudprovider.kubernetes.io/uninitialized\"}]}}",
},
}