3 TEMP_POD=$(kubectl get pod -n $NAMESPACE_ENV --selector \
4 app='{{ include "common.fullname" . }}' -o \
5 jsonpath='{.items[?(@.metadata.ownerReferences[].kind=="ReplicaSet")].metadata.name}')
7 tmp_MYSQL_PASSWORD=$(echo -n $(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- printenv \
8 MYSQL_PASSWORD) | base64)
10 tmp_ROOT_PASSWORD=$(echo -n $(kubectl exec -n $NAMESPACE_ENV $TEMP_POD -- printenv \
11 MYSQL_ROOT_PASSWORD) | base64)
13 FLAG_EX_ROOT_SEC='{{ include "common.secret.getSecretNameFast" (dict "global" . "uid" (include "common.mariadb.secret.rootPassUID" .)) }}'
15 FLAG_EX_SEC='{{ include "common.secret.getSecretNameFast" (dict "global" . "uid" (include "common.mariadb.secret.userCredentialsUID" .)) }}'
17 kubectl patch secret $FLAG_EX_ROOT_SEC -p \
18 '{"data":{"password":"'"$tmp_ROOT_PASSWORD"'"}}'
20 kubectl patch secret $FLAG_EX_SEC -p \
21 '{"data":{"password":"'"$tmp_MYSQL_PASSWORD"'"}}'
23 kubectl delete pod -n $NAMESPACE_ENV {{ include "common.fullname" . }}-0 --now
24 kubectl delete deployment -n $NAMESPACE_ENV {{ include "common.fullname" . }}-upgrade-deployment
25 kubectl delete secret -n $NAMESPACE_ENV {{ include "common.fullname" . }}-temp-upgrade-root
26 kubectl delete secret -n $NAMESPACE_ENV {{ include "common.fullname" . }}-temp-upgrade-usercred