The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6295
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) ===
From 00d060491c9745d52afb31b7a86427106d7e4ae8 Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Wed, 9 Oct 2019 08:22:16 +0200 Subject: [PATCH 1/2] lxd: Fix container restore with projects in Ceph This fixes container restore on Ceph when using projects. Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- lxd/storage_ceph.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd/storage_ceph.go b/lxd/storage_ceph.go index 708b73d3c6..9f25ba1f30 100644 --- a/lxd/storage_ceph.go +++ b/lxd/storage_ceph.go @@ -1566,7 +1566,7 @@ func (s *storageCeph) ContainerRestore(target Instance, source Instance) error { sourceContainerOnlyName, sourceSnapshotOnlyName, _ := shared.ContainerGetParentAndSnapshotName(sourceName) prefixedSourceSnapOnlyName := fmt.Sprintf("snapshot_%s", sourceSnapshotOnlyName) err = cephRBDVolumeRestore(s.ClusterName, s.OSDPoolName, - sourceContainerOnlyName, storagePoolVolumeTypeNameContainer, + project.Prefix(source.Project(), sourceContainerOnlyName), storagePoolVolumeTypeNameContainer, prefixedSourceSnapOnlyName, s.UserName) if err != nil { logger.Errorf(`Failed to restore RBD storage volume for container "%s" from "%s": %s`, targetName, sourceName, err) From 07a2ab7215d62459be98180a4561b077a0023506 Mon Sep 17 00:00:00 2001 From: Thomas Hipp <thomas.h...@canonical.com> Date: Wed, 9 Oct 2019 08:27:49 +0200 Subject: [PATCH 2/2] test: Add container restore with projects This adds a test for restoring a container in a project. Signed-off-by: Thomas Hipp <thomas.h...@canonical.com> --- test/suites/projects.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/suites/projects.sh b/test/suites/projects.sh index 8a0ffcd2fe..ddccb26e35 100644 --- a/test/suites/projects.sh +++ b/test/suites/projects.sh @@ -180,11 +180,12 @@ test_projects_snapshots() { # Create a container in the project lxc init testimage c1 - # Create, rename and delete a snapshot + # Create, rename, restore and delete a snapshot lxc snapshot c1 lxc info c1 | grep -q snap0 lxc config show c1/snap0 | grep -q Busybox lxc rename c1/snap0 c1/foo + lxc restore c1 foo lxc delete c1/foo # Test copies
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel