The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3776

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) ===
Signed-off-by: Christian Brauner <[email protected]>
From ab0cf986e9aedcd91c6bcb20a2dd9a7e6b661523 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Wed, 6 Sep 2017 23:16:40 +0200
Subject: [PATCH 1/2] ceph: apply template on container-only copy too

Signed-off-by: Christian Brauner <[email protected]>
---
 lxd/storage_ceph.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lxd/storage_ceph.go b/lxd/storage_ceph.go
index fb9a5de81..6e7ef6fba 100644
--- a/lxd/storage_ceph.go
+++ b/lxd/storage_ceph.go
@@ -1138,7 +1138,7 @@ func (s *storageCeph) ContainerCopy(target container, 
source container,
 
                logger.Debugf(`Copied RBD container storage %s -> %s`,
                        sourceContainerName, target.Name())
-               return nil
+               goto apply_template
        } else {
                logger.Debugf(`Creating non-sparse copy of RBD storage volume `+
                        `for container "%s" -> "%s" including snapshots`,
@@ -1366,6 +1366,8 @@ func (s *storageCeph) ContainerCopy(target container, 
source container,
                        sourceContainerName, targetContainerName)
        }
 
+apply_template:
+
        ourMount, err := s.ContainerMount(target)
        if err != nil {
                return err

From d47ff8e6d59503744ea815941a01a496d4ffe646 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Wed, 6 Sep 2017 23:23:18 +0200
Subject: [PATCH 2/2] ceph: set ACL on container copy

Signed-off-by: Christian Brauner <[email protected]>
---
 lxd/storage_ceph.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxd/storage_ceph.go b/lxd/storage_ceph.go
index 6e7ef6fba..cbee2ced8 100644
--- a/lxd/storage_ceph.go
+++ b/lxd/storage_ceph.go
@@ -1376,6 +1376,11 @@ apply_template:
                defer s.ContainerUmount(target.Name(), 
targetContainerMountPoint)
        }
 
+       err = s.setUnprivUserACL(source, targetContainerMountPoint)
+       if err != nil {
+               return err
+       }
+
        err = target.TemplateApply("copy")
        if err != nil {
                logger.Errorf(`Failed to apply copy template for container `+
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to