Files
kubevela/hack/utils/installdefinition.sh
Afzal Ansari 8d99a35f01 Fix: Refactors shell to have double quotes format (#3830)
* refactors double quote to prevent globbing and word splitting e2e sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors e2e_core sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors cleanup sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors header-chk sh

Signed-off-by: afzal442 <afzal442@gmail.com>

* refactors installdef sh

Signed-off-by: afzal442 <afzal442@gmail.com>
2022-05-09 11:23:45 +08:00

33 lines
775 B
Bash
Executable File

#! /bin/bash
DEF_PATH="charts/vela-core/templates/defwithtemplate"
function check_install() {
res=`kubectl get namespace -A | grep vela-system`
if [ -n "$res" ];then
echo 'vela-system namespace exist'
else
echo 'vela-system namespace do not exist'
echo 'creating vela-system namespace ...'
kubectl create namespace vela-system
fi
echo "applying definitions ..."
cd "$DEF_PATH"
for file in *.yaml ;
do
echo "Info: changing "$DEF_PATH"/""$file"
sed -i.bak "s#namespace: {{ include \"systemDefinitionNamespace\" . }}#namespace: vela-system#g" "$file"
kubectl apply -f "$file"
rm "$file"
mv "$file"".bak" "$file"
done
cd -
}
check_install
DEF_PATH="charts/vela-core/templates/definitions"
check_install