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.
This commit is contained in:
Jan Chaloupka 2019-10-29 12:50:24 +01:00
parent 362e17ff9f
commit 821220ecac

View File

@ -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