Repository navigation
Add the ExternalVolumeSnapshot resource - #3822
Open
Sneha-at (Sneha-at) wants to merge 3 commits into
Open
Sneha-at (Sneha-at) wants to merge 3 commits into
Sneha-at (Sneha-at) wants to merge 3 commits into
Conversation
An ExternalVolumeSnapshot records one external volume snapshot. It is owned by the tag in origin.tag, in the same atespace. The API has Get and List only, and viewers of the atespace may use them.
Snapshots live in a new external_volume_snapshots table. Foreign keys keep a tag or its atespace from being deleted while the tag owns snapshots, and DeleteTag reports that as FailedPrecondition. Create locks the tag row, and refuses a tag with a different uid, one being deleted, or one without a PENDING durable snapshot. No request carries a snapshot, so validation-gen generates no validator for it. The store validates every write by hand, and lets an update change only status: the handle and size are set once, ready_to_use only becomes true, ready_to_use and size_bytes need a handle, and error_message is cleared only by the write that records the handle. GetExternalVolumeSnapshot and ListExternalVolumeSnapshots need the ExternalVolumes preview gate and a client that opts in.
The command lists or gets snapshots in an atespace or all atespaces. --tag keeps the snapshots of one tag, filtered in the client since the API has no filter. It needs --atespace, because a tag name is unique only within an atespace. The STATE column is derived from status.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #1951
First step of the ExternalVolumeSnapshot design: an atespace-scoped object
for each external volume snapshot, readable through its own RPCs. Nothing
creates the objects yet. CreateTag and DeleteTag start using them in #3748,
which will be reworked onto this PR.
API
ExternalVolumeSnapshotwith a tag origin (tag,tag_uid,source_volume_name,source_volume_id) and a status(
storage_snapshot_id,ready_to_use,size_bytes,error_message).GetExternalVolumeSnapshotandListExternalVolumeSnapshots, behind theExternalVolumes preview gate. An empty atespace lists every atespace and
needs global viewer.
Store
external_volume_snapshots, with foreign keys to atespaces andto tags, both ON DELETE RESTRICT, and an index on
(atespace, tag_name, tag_uid).
with that uid, has a PENDING durable snapshot, and is not marked for
deletion.
status:ready_to_useonly moves from false to true.ready_to_useandsize_bytesneed a handle.error_message, and recording the handleclears it.
CLI
kubectl ate get externalvolumesnapshot, with-aor-A, plus--tag,which needs
-a.Failed, Captured or Ready.
Testing
DeleteTag, authz, validation and CLI tests.
-race -count=3 -shuffle=on.hack/verify-all.shpasses.I used an AI coding agent to implement this from the design, review it
adversarially, and draft this description. I reviewed the result myself.