From 821220ecace1b172844b2ab1b8204778204bba62 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Tue, 29 Oct 2019 12:50:24 +0100 Subject: [PATCH] test/e2e: AddOrUpdateAvoidPodOnNode/RemoveAvoidPodsOffNode: retry when conflict hit during annotation update In case node object update fails due to revision conflict, it does not make sense to return success. It needs to be retried so the v1.PreferAvoidPodsAnnotationKey annotation can be properly set in the next round. --- test/e2e/framework/util.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 0319b12e9dc..de8708d2d0e 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -1560,6 +1560,7 @@ func AddOrUpdateAvoidPodOnNode(c clientset.Interface, nodeName string, avoidPods ExpectNoError(err) } else { Logf("Conflict when trying to add/update avoidPods %v to %v with error %v", avoidPods, nodeName, err) + return false, nil } } return true, nil @@ -1588,6 +1589,7 @@ func RemoveAvoidPodsOffNode(c clientset.Interface, nodeName string) { ExpectNoError(err) } else { Logf("Conflict when trying to remove avoidPods to %v", nodeName) + return false, nil } } return true, nil