fix for ubuntu 24.04
This commit is contained in:
@@ -9,19 +9,16 @@ while IFS= read -r line; do
|
|||||||
blacklist+=("$line")
|
blacklist+=("$line")
|
||||||
done < "$BASEPATH/path-blacklist.txt"
|
done < "$BASEPATH/path-blacklist.txt"
|
||||||
|
|
||||||
y2j() {
|
|
||||||
python3 -c 'import sys, yaml, json; print(json.dumps(yaml.safe_load(sys.stdin.read())))' < "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Parse Docker Compose file to get all services
|
# Parse Docker Compose file to get all services
|
||||||
services=$(y2j $BASEPATH/$1.yml | jq -r '.services | keys | .[]')
|
services=$(cat $BASEPATH/$1.yml | yaml2json | jq -r '.services | keys | .[]')
|
||||||
echo $services
|
echo $services
|
||||||
for service in $services; do
|
for service in $services; do
|
||||||
|
|
||||||
IFS=$'\t' read -r -a labels <<< $(y2j "$BASEPATH/$1.yml" | jq -r ".services[\"$service\"].labels | @tsv")
|
IFS=$'\t' read -r -a labels <<< $(cat "$BASEPATH/$1.yml" | yaml2json | jq -r ".services[\"$service\"].labels[]")
|
||||||
|
|
||||||
for label in "${labels[@]}"; do
|
for label in "${labels[@]}"; do
|
||||||
if [[ "$label" == *"stripprefix.prefixes"* ]]; then
|
if [[ "$label" == *"stripprefix.prefixes"* ]]; then
|
||||||
|
echo $label
|
||||||
path=$(echo "$label" | cut -d "=" -f 2)
|
path=$(echo "$label" | cut -d "=" -f 2)
|
||||||
break # Stop looping after finding the first match
|
break # Stop looping after finding the first match
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user