Help developer install build-in necessary definitions. (#1907)

* fix

* add install def shell

* change to make command

* fix shell

* fix bak
This commit is contained in:
wangyuan249
2021-07-20 14:05:39 +08:00
committed by GitHub
parent 21cde39c50
commit d77969b52e
5 changed files with 37 additions and 3 deletions

View File

@@ -321,3 +321,6 @@ swagger-gen:
check-license-header:
./hack/licence/header-check.sh
check-install-def:
./hack/utils/installdefinition.sh

View File

@@ -5,7 +5,7 @@ metadata:
annotations:
definition.oam.dev/description: "raw allow users to specify raw K8s object in properties"
name: raw
namespace: vela-system
namespace: {{.Values.systemDefinitionNamespace}}
spec:
workload:
type: autodetects.core.oam.dev

View File

@@ -78,8 +78,13 @@ Firstly make sure your cluster has CRDs, below is the command that can help inst
make core-install
```
Run locally:
To ensure you have created vela-system namespace and install definitions of necessary module.
you can run the command:
```shell script
make check-install-def
```
And then run locally:
```shell script
make core-run
```

26
hack/utils/installdefinition.sh Executable file
View File

@@ -0,0 +1,26 @@
#! /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: {{.Values.systemDefinitionNamespace}}#namespace: vela-system#g" $file
kubectl apply -f $file
rm $file
mv $file".bak" $file
done
}
check_install

View File

@@ -4,7 +4,7 @@ metadata:
annotations:
definition.oam.dev/description: "raw allow users to specify raw K8s object in properties"
name: raw
namespace: vela-system
namespace: {{.Values.systemDefinitionNamespace}}
spec:
workload:
type: autodetects.core.oam.dev