-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Denilson Nastacio <[email protected]>
- Loading branch information
Showing
3 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
config/cloudpaks/cp4d/templates/0100-sync-install-zen-workaround.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
# https://www.ibm.com/support/pages/node/7087504 | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/hook: Sync | ||
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation | ||
argocd.argoproj.io/sync-wave: "101" | ||
name: sync-cp4d-install-zen-workaround | ||
namespace: {{.Values.metadata.argocd_namespace}} | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: patch-zen-database | ||
image: "icr.io/cpopen/cpd/olm-utils-v2:{{.Values.version}}" | ||
env: | ||
- name: PROJECT_CPD_INST_OPERANDS | ||
value: {{.Values.metadata.operands_namespace}} | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
set -eo pipefail | ||
set -x | ||
result=1 | ||
while [ ${result} -eq 1 ] && [ ${SECONDS} -lt 7200 ] | ||
do | ||
oc get deployment zen-databases \ | ||
-n ${PROJECT_CPD_INST_OPERANDS} \ | ||
&& result=0 \ | ||
|| { | ||
echo "INFO: Waiting on Zen database deployment to patch it" | ||
sleep 60 | ||
} | ||
done | ||
if [ ${result} -eq 0 ]; then | ||
oc patch deployment zen-databases \ | ||
-n ${PROJECT_CPD_INST_OPERANDS} \ | ||
--type='json' \ | ||
-p='[{"op": "add", "path": "/spec/template/spec/containers/0/env/-", "value": {"name": "npm_config_cache", "value": "/tmp"}}]' \ | ||
|| { | ||
echo "ERROR: CP4D installation failed." | ||
result=1 | ||
} | ||
fi | ||
exit ${result} | ||
restartPolicy: Never | ||
serviceAccountName: {{.Values.serviceaccount.argocd_application_controller}} | ||
|
||
backoffLimit: 2 |