kubedog
kubedog copied to clipboard
Retries for UPDATE/UPSERT Resource Steps
The steps below can be added to feature files that allow them to update/upsert resources during tests.
https://github.com/keikoproj/kubedog/blob/bb3a5e16e0d4ccfd96e40a632929653c81a61da7/kubedog.go#L48-L53
In some circumstances, there may be resources that are acted on by other services within a testing environment (e.g. Horizontal Pod Autoscaler). If that resource is updated by another actor, you can get errors like below:
Error: Operation cannot be fulfilled on horizontalpodautoscalers.autoscaling "iks-express-test-asset-rollout-hpa": the object has been modified; please apply your changes to the latest version and try again
To get around this, we can always update the resource version of the resource that is going to be updated in the test. However, we may need to retry in some cases if the resource is being continuously updated in a way that conflicts with the tests updated. If we implement a retry option for these steps, it may help to avoid these conflicts during tests.