test: Optimistic Locking integration test suite #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
OptimisticLockIT
test suite verifies the Kubernetes API behavior when dealing with themetadata.resourceVersion
field.The K8s API doesn't provide an idempotent behavior when performing PUT requests as stated in the API conventions document (however, it does for certain resources):
https://github.com/kubernetes/community/blob/00e50166cc289d5afb22c2159640134fd8d72c58/contributors/devel/sig-architecture/api-conventions.md
In the
Concurrency Control
section, this point is not that clear:The wording here is not that clear and suggests that the
resourceVersion
field can be omitted to bypass optimistic locking. That may be the reasoning behind the inconsistent behavior of PUT operations depending on the resource.Related
is invalid: metadata.resourceVersion: Invalid value: 0x0: must be specified for an update
{"reason":"FieldValueInvalid","message":"Invalid value: 0x0: must be specified for an update","field":"metadata.resourceVersion"}
/cc @shawkins @csviri