mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
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:
parent
362e17ff9f
commit
821220ecac
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user