This commit is contained in:
goldsquid
2026-06-06 11:49:31 +07:00
parent 1aef140a9a
commit aa5ffb63b6
5 changed files with 6 additions and 42 deletions

View File

@@ -12,7 +12,7 @@ is_ephemeral_volume_key() {
if [[ -n "$compose_file" && -f "$compose_file" ]]; then
local ephemeral
ephemeral=$(yaml2json "$compose_file" 2>/dev/null | jq -r '.["x-ephemeral-volumes"] // [] | .[]' 2>/dev/null)
ephemeral=$(yaml2json < "$compose_file" 2>/dev/null | jq -r '.["x-ephemeral-volumes"] // [] | .[]' 2>/dev/null)
while IFS= read -r vol; do
[[ -z "$vol" ]] && continue
[[ "$key" == "$vol" ]] && return 0
@@ -24,7 +24,7 @@ is_ephemeral_volume_key() {
get_volume_keys() {
local compose_file=$1
yaml2json "$compose_file" 2>/dev/null | jq -r '.volumes | keys[]' 2>/dev/null
yaml2json < "$compose_file" 2>/dev/null | jq -r '.volumes | keys[]' 2>/dev/null
}
get_persistent_volume_keys() {