Fix secret location with absolute paths

Signed-off-by: Andrea Giardini <contact@andreagiardini.com>
This commit is contained in:
Andrea Giardini 2017-09-20 23:05:29 +02:00 committed by Joffrey F
parent 8c38651196
commit 18df4915f2
1 changed files with 6 additions and 3 deletions

View File

@ -881,6 +881,9 @@ class Service(object):
def get_secret_volumes(self): def get_secret_volumes(self):
def build_spec(secret): def build_spec(secret):
if secret['secret'].target is not None and secret['secret'].target.startswith('/'):
target = secret['secret'].target
else:
target = '{}/{}'.format( target = '{}/{}'.format(
const.SECRETS_PATH, const.SECRETS_PATH,
secret['secret'].target or secret['secret'].source) secret['secret'].target or secret['secret'].source)