Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage: Fix import of instance snapshots with underscores in their names #13899

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

tomponline
Copy link
Member

@tomponline tomponline commented Aug 9, 2024

Fixes #13879
Closes #13897

…rt in CreateInstanceFromBackup

Fixes canonical#13879

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
…dName

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
…pshot names

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
@tomponline tomponline merged commit f69ab6c into canonical:main Aug 9, 2024
29 checks passed
@tomponline tomponline deleted the tp-snapshot-import branch August 9, 2024 13:44
@@ -658,7 +658,11 @@ func ValidName(instanceName string, isSnapshot bool) error {
return fmt.Errorf("Invalid instance name %q: %w", parentName, err)
}

// Snapshot part is more flexible, but doesn't allow space or / character.
// Snapshot part is more flexible, but doesn't allow "..", space or / characters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also reject *?

$ lxc snapshot c1 '.*'
Error: Create instance snapshot: Failed to run: zfs snapshot -r default/containers/c1@snapshot-.*: exit status 1 (cannot create snapshot 'default/containers/c1@snapshot-.*': invalid character '*' in name
no snapshots were created)

And also @ and # which have special meaning in ZFS at least.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah maybe - although this might break users who've used snapshots with those chars in on non-zfs drivers.

tomponline added a commit to tomponline/lxd-pkg-snap that referenced this pull request Aug 20, 2024
From canonical/lxd#13899

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
tomponline added a commit to canonical/lxd-pkg-snap that referenced this pull request Aug 20, 2024
- Fix Dell Powerflex migrations from
canonical/lxd#13934
- Fix snap preseed support from
#532
- Fix snapshot importing from
canonical/lxd#13899
tomponline added a commit to tomponline/lxd-pkg-snap that referenced this pull request Aug 20, 2024
  - Fix for Oracular unprivileged containers from canonical/lxd#13820
  - Fix snapshot importing from canonical/lxd#13899
  - Fix Dell Powerflex migrations from canonical/lxd#13934

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
tomponline added a commit to canonical/lxd-pkg-snap that referenced this pull request Aug 20, 2024
- Fix Dell Powerflex migrations from
canonical/lxd#13934
- Fix snap preseed support from
#532
- Fix snapshot importing from
canonical/lxd#13899
- Vendor apparmor and cherry-pick Oracular container fixes from
#534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"lxc import" fails if a snapshot name contains non-alphanumeric characters
3 participants