forked from extern/podman-compose
FIXES #440: absolute secret
This commit is contained in:
parent
2d1bcddf09
commit
af10345483
@ -445,9 +445,11 @@ def get_secret_args(compose, cnt, secret):
|
||||
dest_file = f'/run/secrets/{secret_name}'
|
||||
elif not target.startswith("/"):
|
||||
sec = target if target else secret_name
|
||||
dest_file = f's/run/secrets/{sec}'
|
||||
dest_file = f'/run/secrets/{sec}'
|
||||
else:
|
||||
dest_file = target
|
||||
basedir = compose.dirname
|
||||
source_file = os.path.realpath(os.path.join(basedir, os.path.expanduser(source_file)))
|
||||
volume_ref = [
|
||||
'--volume', f'{source_file}:{dest_file}:ro,rprivate,rbind'
|
||||
]
|
||||
@ -921,6 +923,8 @@ class Podman:
|
||||
return volumes
|
||||
|
||||
def normalize_service(service, sub_dir=''):
|
||||
# make `build.context` relative to sub_dir
|
||||
# TODO: should we make volume and secret relative too?
|
||||
if sub_dir and 'build' in service:
|
||||
build = service['build']
|
||||
context = build if is_str(build) else build.get('context', None)
|
||||
|
@ -1,3 +1,7 @@
|
||||
---
|
||||
# echo "sec" | podman secret create my_secret -
|
||||
# echo "sec2" | podman secret create my_secret_2 -
|
||||
# echo "sec3" | podman secret create my_secret_3 -
|
||||
version: "3.8"
|
||||
services:
|
||||
test:
|
||||
|
Loading…
Reference in New Issue
Block a user