Browse Source

chg: remove charm-store inner link support

Links were poorly supported and are a pain in the ass
due to docker volumes deferencing links in the container
side before making the bind mount, preventing overriding
links in the container file system.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
lokavaluto/dev/master
Valentin Lab 5 years ago
parent
commit
a968ccc3a9
  1. 16
      bin/compose

16
bin/compose

@ -358,15 +358,17 @@ clean_unused_sessions() {
} }
relink_subdirs() {
check_no_links_subdirs() {
local dir local dir
for dir in "$@"; do for dir in "$@"; do
[ -L "$dir" ] || continue
target=$(realpath "$dir")
[ -d "$target" ] || continue
docker_run_opts+=("-v" "$target:$dir")
[ -d "$dir" ] || continue
if [ -L "$dir" ]; then
err "Unfortunately, this compose launcher do not support yet symlinks in charm-store."
echo " Found symlink in charm-store: $dir" >&2
return 1
fi
[ -e "$dir/metadata.yml" ] && continue [ -e "$dir/metadata.yml" ] && continue
relink_subdirs "$dir"/*
check_no_links_subdirs "$dir"/* || return 1
done done
} }
@ -540,7 +542,7 @@ mk_docker_run_options() {
"-e" "CHARM_STORE=/srv/charm-store" "-e" "CHARM_STORE=/srv/charm-store"
"-e" "HOST_CHARM_STORE=$CHARM_STORE" "-e" "HOST_CHARM_STORE=$CHARM_STORE"
) )
relink_subdirs "$CHARM_STORE"/*
check_no_links_subdirs "$CHARM_STORE"/* || exit 1
## DEFAULT_COMPOSE_FILE ## DEFAULT_COMPOSE_FILE
if [ "${DEFAULT_COMPOSE_FILE+x}" ]; then if [ "${DEFAULT_COMPOSE_FILE+x}" ]; then

Loading…
Cancel
Save