StarlingX build tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
810 B

#!/bin/bash
OP=$1
CHARTDIR=$2
if [ -z "$OP"]; then
exit 1
fi
if [ -z "$CHARTDIR"]; then
exit 1
fi
if [ $OP == "waitlabel" ]; then
KIND=("Deployment" "StatefulSet" "DaemonSet")
if [ ! -d $CHARTDIR/templates ]; then
exit 1
fi
cd $CHARTDIR/templates
for target in ${KIND[@]}; do
output=$(grep $target . -rn | awk -F ':' '{print$1}' \
| xargs awk -F ':' '/{{ .Release.Name }}/{print$1; exit}')
if [ "x$output" != "x" ]; then
echo $output
exit 0
fi
done
elif [ $OP == "chartname" ]; then
if [ ! -f $CHARTDIR/Chart.yaml ]; then
exit 1
fi
cd $CHARTDIR
output=$(awk '/name:/{print$2;exit}' Chart.yaml)
if [ "x$output" != "x" ]; then
echo $output
exit 0
fi
fi
exit 1