fix(canopy): select restore snapshot by id alone, not the canopy-type tag#657
Open
passcod wants to merge 2 commits into
Open
fix(canopy): select restore snapshot by id alone, not the canopy-type tag#657passcod wants to merge 2 commits into
passcod wants to merge 2 commits into
Conversation
… tag kopia's snapshot list output does not echo the user tags set at snapshot-create time, so the snapshot's canopy-type tag was always absent when selecting. Gating selection on it rejected every snapshot, so restoring by a valid, correct id failed with 'no snapshot matching id'. Match on the id alone; the backup type still selects the def, method, and credentials.
…cess kopia's snapshot list does not echo the tags set at snapshot-create time, so the parsed snapshots carried no tags and the in-process tag filter matched nothing. Pass --tags to kopia so it filters against the manifest labels, and drop the tag field from the in-process filter. Affects 'bestool kopia list --tag' and the --tag snapshot picker used by restore/mount.
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.
🤖 Restoring a snapshot by a valid, correct id failed with
no snapshot matching id '<id>' in the repository, even on the server that took the backup, in the right group, with a live restore credential.The cause:
select_snapshotmatched ons.id.starts_with(id) && s.tags.get("canopy-type") == Some(type). But kopia'ssnapshot listoutput does not echo the tags set at snapshot-create time (it stores them as manifest labels), so every listed snapshot deserialises with no tags. The tag half of the condition was therefore always false, and selection rejected every snapshot regardless of the id. The unit tests passed only because they hand-constructedtagsmaps that real kopia output never contains.This matches by id alone. The backup type still selects the def, method, and credential scope in the caller; it no longer gates snapshot selection. When no id matches, the error now lists the ids the connected repository actually holds (id, source server, taken-at), rather than leaving the operator to guess.
Also updates the restore spec to the current shape (positional
<type> <id>, id-only selection, not scoped to the issuing server).Also: the same bug in the generic snapshot filter
SnapshotFilterfiltered listings by.tagsread back from the same taglesssnapshot listoutput, sobestool kopia list --tagand the--tagsnapshot picker (restore/mount) matched nothing too. Tag filtering now passes--tags KEY:VALUEto kopia, which filters against the manifest labels; the in-process filter no longer carries tags.