The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6579
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === This fixes #6577
From 191864ebf6b5d87ecbb577ebda0c80dd49315cc0 Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Mon, 9 Dec 2019 17:22:42 +0100 Subject: [PATCH 1/2] lxd: Fix backup creation with hyphenated instance name on LVM This fixes a bug where hyphenated instance names (e.g. test1-test2) would fail to be exported when using LVM as the storage backend. Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- lxd/storage_lvm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd/storage_lvm.go b/lxd/storage_lvm.go index 2c35f0fecd..122ac4a42e 100644 --- a/lxd/storage_lvm.go +++ b/lxd/storage_lvm.go @@ -1739,7 +1739,7 @@ func (s *storageLvm) ContainerBackupCreate(path string, backup backup.Backup, so } defer os.RemoveAll(tmpContainerMntPoint) - _, err = s.createSnapshotLV(source.Project(), poolName, source.Name(), + _, err = s.createSnapshotLV(source.Project(), poolName, containerNameToLVName(source.Name()), storagePoolVolumeAPIEndpointContainers, containerNameToLVName(sourceLvmDatasetSnapshot), storagePoolVolumeAPIEndpointContainers, false, s.useThinpool) if err != nil { From 58ce165541b75d1e6d104c1249535dd16142167a Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Mon, 9 Dec 2019 17:25:30 +0100 Subject: [PATCH 2/2] test/suites/backup: Test hyphenated container names This tests hyphenated container names when creating backups. Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- test/suites/backup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/suites/backup.sh b/test/suites/backup.sh index bfac561a23..5937cbebac 100644 --- a/test/suites/backup.sh +++ b/test/suites/backup.sh @@ -352,6 +352,14 @@ test_backup_export_with_project() { lxc delete --force c1 rm -rf "${LXD_DIR}/optimized" "${LXD_DIR}/non-optimized" + # Check if hyphens cause issues when creating backups + lxc launch testimage c1-foo + lxc snapshot c1-foo + + lxc export c1-foo "${LXD_DIR}/c1-foo.tar.gz" + + lxc delete --force c1-foo + if [ "$#" -ne 0 ]; then lxc image rm testimage lxc project switch default
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel