Skip to content

[v14] Propagate resource revision to/from the backend#33214

Merged
rosstimothy merged 1 commit intobranch/v14from
tross/backport-32040/v14
Oct 17, 2023
Merged

[v14] Propagate resource revision to/from the backend#33214
rosstimothy merged 1 commit intobranch/v14from
tross/backport-32040/v14

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Oct 10, 2023

Backport #32040 and part of #32871 to branch/v14

While this is not functionally required since the backends in v14 don't know about revisions it should reduce conflicts and unify revision handling during resource marshaling.

@rosstimothy rosstimothy force-pushed the tross/backport-32040/v14 branch from 634301f to 8911f83 Compare October 10, 2023 14:28
@rosstimothy rosstimothy marked this pull request as ready for review October 10, 2023 15:19
@github-actions github-actions Bot added application-access backport database-access Database access related issues and PRs discovery kubernetes-access size/md tctl tctl - Teleport admin tool labels Oct 10, 2023
@rosstimothy rosstimothy enabled auto-merge October 10, 2023 18:12
@rosstimothy
Copy link
Copy Markdown
Contributor Author

Friendly ping @justinas

@rosstimothy
Copy link
Copy Markdown
Contributor Author

PTAL @justinas

@rosstimothy rosstimothy requested a review from zmb3 October 16, 2023 17:20
@rosstimothy rosstimothy added this pull request to the merge queue Oct 17, 2023
@rosstimothy rosstimothy removed this pull request from the merge queue due to a manual request Oct 17, 2023
* Set revision on resources retrieved from the backend

Adds a new `MarshalOption` that ensures the resource revision is
set when unmarshalling a backend item. The new `WithRevision` option
was also applied everywhere that the legacy `WithResourceID` was
being used.

* Prevent storing resource revision in the backend item value

The revision follows the same semantics as the resource id for
marshalling. This prevents both items from showing up in the value
of the backend item, which can prevent compare and swap operations
from completing succesfully. Each backend is responsible for
persisting the revision in some manner.

The existing PreserveResourceID was reused to prevent having to
make multiple copies of a resource when clearing the id and revision.
The marshal option will be updated in a follow up when the resource
id is removed.

* Prevent backend items with empty revisions

All resource revisions are now being set on a backend.Item before
persisting the item to the backend.

* Ignore revision in resource comparisons
@rosstimothy rosstimothy force-pushed the tross/backport-32040/v14 branch from 8911f83 to 903d831 Compare October 17, 2023 14:33
@rosstimothy rosstimothy enabled auto-merge October 17, 2023 14:34
@rosstimothy rosstimothy added this pull request to the merge queue Oct 17, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 17, 2023
@rosstimothy rosstimothy added this pull request to the merge queue Oct 17, 2023
Merged via the queue into branch/v14 with commit 08d4939 Oct 17, 2023
@rosstimothy rosstimothy deleted the tross/backport-32040/v14 branch October 17, 2023 15:17
@camscale camscale mentioned this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants