diff options
author | Andrea Giardini <contact@andreagiardini.com> | 2017-09-20 23:05:29 +0200 |
---|---|---|
committer | Joffrey F <f.joffrey@gmail.com> | 2017-10-17 17:20:00 -0700 |
commit | 18df4915f21fb43100b24f181e851a3f0a14eb9a (patch) | |
tree | 3e470ff6c3119315a659322c1905afe28db7cf6a | |
parent | 8c38651196c626c64ff22a22a8d606ed9d88e305 (diff) |
Fix secret location with absolute paths
Signed-off-by: Andrea Giardini <contact@andreagiardini.com>
-rw-r--r-- | compose/service.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compose/service.py b/compose/service.py index 28c03276..aecafc8c 100644 --- a/compose/service.py +++ b/compose/service.py @@ -881,9 +881,12 @@ class Service(object): def get_secret_volumes(self): def build_spec(secret): - target = '{}/{}'.format( - const.SECRETS_PATH, - secret['secret'].target or secret['secret'].source) + if secret['secret'].target is not None and secret['secret'].target.startswith('/'): + target = secret['secret'].target + else: + target = '{}/{}'.format( + const.SECRETS_PATH, + secret['secret'].target or secret['secret'].source) return VolumeSpec(secret['file'], target, 'ro') return [build_spec(secret) for secret in self.secrets] |