Merge pull request #33872 from kevin-wangzefeng/fix-kubectl-taint-e2e

Automatic merge from submit-queue

fix kubectl taint e2e flake: add retries for removing taint

**What this PR does / why we need it**:
Why we need it: recent failures occurred in #29503 are caused by taints removing conflict on nodes, this PR is to fix it. (#33073 fixed taints updating conflict, but not taints removing.)

What this PR does: use `runKubectlRetryOrDie()` instead of `RunKubectlOrDie()` in all the places in "Kubectl taint" e2e tests.

**Which issue this PR fixes** : fixes part of #29503, (would like to keep this issue open for some days more to make sure no other failures occur)

**Special notes for your reviewer**: NONE

**Release note**: NONE
This commit is contained in:
Kubernetes Submit Queue 2016-10-01 19:22:59 -07:00 committed by GitHub
commit 4f27c740fa

View File

@ -1293,7 +1293,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("adding the taint " + testTaint.ToString() + " to a node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.ToString())
By("verifying the node has the taint " + testTaint.ToString())
output := framework.RunKubectlOrDie("describe", "node", nodeName)
output := runKubectlRetryOrDie("describe", "node", nodeName)
requiredStrings := [][]string{
{"Name:", nodeName},
{"Taints:"},
@ -1304,7 +1304,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("removing the taint " + testTaint.ToString() + " of a node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.Key+":"+string(testTaint.Effect)+"-")
By("verifying the node doesn't have the taint " + testTaint.Key)
output = framework.RunKubectlOrDie("describe", "node", nodeName)
output = runKubectlRetryOrDie("describe", "node", nodeName)
if strings.Contains(output, testTaint.Key) {
framework.Failf("Failed removing taint " + testTaint.Key + " of the node " + nodeName)
}
@ -1325,7 +1325,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("adding the taint " + testTaint.ToString() + " to a node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.ToString())
By("verifying the node has the taint " + testTaint.ToString())
output := framework.RunKubectlOrDie("describe", "node", nodeName)
output := runKubectlRetryOrDie("describe", "node", nodeName)
requiredStrings := [][]string{
{"Name:", nodeName},
{"Taints:"},
@ -1341,7 +1341,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("adding another taint " + newTestTaint.ToString() + " to the node")
runKubectlRetryOrDie("taint", "nodes", nodeName, newTestTaint.ToString())
By("verifying the node has the taint " + newTestTaint.ToString())
output = framework.RunKubectlOrDie("describe", "node", nodeName)
output = runKubectlRetryOrDie("describe", "node", nodeName)
requiredStrings = [][]string{
{"Name:", nodeName},
{"Taints:"},
@ -1352,7 +1352,7 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
By("removing all taints that have the same key " + testTaint.Key + " of the node")
runKubectlRetryOrDie("taint", "nodes", nodeName, testTaint.Key+"-")
By("verifying the node doesn't have the taints that have the same key " + testTaint.Key)
output = framework.RunKubectlOrDie("describe", "node", nodeName)
output = runKubectlRetryOrDie("describe", "node", nodeName)
if strings.Contains(output, testTaint.Key) {
framework.Failf("Failed removing taints " + testTaint.Key + " of the node " + nodeName)
}