From fc1caced86b80bb171f495a0f09aed3ef867ab01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Mon, 17 Jul 2017 09:46:24 +0200 Subject: [PATCH] Only copy symlinks when merge and preserve_properties are set The kolla-kubernetes config files live in a ..data directory in the config volume and are symlinked with relative path at the root of the config volume. This naturally breaks with the link copy feature introduce in I92a404b8d301937dc1847d42576e30db43951990. This commit restores the original behavior to copy the target of the link unless both 'merge' and 'preserve_properties' options are set, in which case the link itself is copied. Change-Id: I5d768687208205fb50ef5ab93675f47e98ea6351 --- docker/base/set_configs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py index b6c56ca97e..65ce210ba1 100644 --- a/docker/base/set_configs.py +++ b/docker/base/set_configs.py @@ -75,7 +75,7 @@ class ConfigFile(object): self._delete_path(dest) # dest endswith / means copy the to folder LOG.info('Copying %s to %s', source, dest) - if os.path.islink(source): + if self.merge and self.preserve_properties and os.path.islink(source): link_target = os.readlink(source) os.symlink(link_target, dest) else: