Add Templates to pretty config

This commit is contained in:
Nikolai Rodionov 2024-05-10 13:03:04 +02:00
parent 8bed95dd3e
commit 815ae64e32
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
2 changed files with 2 additions and 3 deletions

View File

@ -11,7 +11,7 @@ configVersion: v1
kubernetes: kubernetes:
- name: Watch application configmaps getting created - name: Watch application configmaps getting created
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: Secret
executeHookOnSynchronization: false executeHookOnSynchronization: false
executeHookOnEvent: ["Added", "Modified"] executeHookOnEvent: ["Added", "Modified"]
jqFilter: ".data" jqFilter: ".data"
@ -27,7 +27,5 @@ else
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH) export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
export SP_APPLICATION=$(jq -r .[0].object.data.values $BINDING_CONTEXT_PATH | base64 -d | yq '.helm.release') export SP_APPLICATION=$(jq -r .[0].object.data.values $BINDING_CONTEXT_PATH | base64 -d | yq '.helm.release')
envsubst < /tpls/flux-create.yaml | kubectl create -f - envsubst < /tpls/flux-create.yaml | kubectl create -f -
kubectl patch configmap -n ${SP_CUSTOMER_ID} ${SP_ENVIRONMENT} \
-p '{"metadata":{"finalizers":["softplayer.net/bootstrapped"]}}' --type=merge
fi fi

View File

@ -27,6 +27,7 @@ else
echo "ERROR: template not found for ${SP_PROVIDER}-${SP_KUBERNETES}" echo "ERROR: template not found for ${SP_PROVIDER}-${SP_KUBERNETES}"
exit 1 exit 1
fi fi
export SP_CUSTOMER_ID=$(jq -r .[0].object.metadata.namespace $BINDING_CONTEXT_PATH) export SP_CUSTOMER_ID=$(jq -r .[0].object.metadata.namespace $BINDING_CONTEXT_PATH)
export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH) export SP_ENVIRONMENT=$(jq -r .[0].object.metadata.name $BINDING_CONTEXT_PATH)
envsubst < /tpls/${SP_PROVIDER}-${SP_KUBERNETES}.yaml | kubectl create -f - envsubst < /tpls/${SP_PROVIDER}-${SP_KUBERNETES}.yaml | kubectl create -f -