Skip to content

Commit

Permalink
add workaround for non-mcp cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Sébastien Chabrolles <[email protected]>
  • Loading branch information
schabrolles committed May 26, 2024
1 parent 0ae3ca6 commit 7f5d1e1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 132 deletions.
4 changes: 2 additions & 2 deletions charts/cpd-install-pipeline/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.2
version: 1.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.1"
appVersion: "1.1.0"
128 changes: 0 additions & 128 deletions charts/cpd-install-pipeline/README.md

This file was deleted.

6 changes: 4 additions & 2 deletions charts/cpd-install-pipeline/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Your Pipeline to install CPD on your cluster has been deployed.
you can use the openshift console to start the installation graphically
or use "oc create -f" with a PipelineRun yaml file. (example bellow)
or use "oc create -f" with a PipelineRun yaml file. (example bellow)

```
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
Expand Down Expand Up @@ -46,4 +47,5 @@ spec:
taskRunTemplate:
serviceAccountName: pipeline
timeouts:
pipeline: 5h0m0s
pipeline: 5h0m0`
```
13 changes: 13 additions & 0 deletions charts/cpd-install-pipeline/templates/cpd-install-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ spec:
value: |-
add-icr-cred-to-global-pull-secret \
--entitled_registry_key=$(params.IBM_ENTITLEMENT_KEY)
if [[ $(oc get mcp -o name | wc -l) -eq 0 ]]; then
echo
echo "non-MCP cluster detected, activating workaround"
oc debug $(oc get node -o name | head -n1) -- chroot /host cat /.docker/config.json > /tmp/config.json
cat /tmp/config.json | jq --arg auth cp:$(params.IBM_ENTITLEMENT_KEY) '.auths += {"cp.icr.io": {"auth": $auth|@base64}}' > /tmp/config.json.new
sleep 1
for n in `oc get node -o name`; do
oc adm copy-to-node --copy=/tmp/config.json.new=/.docker/config.json $n
done
fi
taskRef:
kind: Task
name: olm-utils
Expand Down

0 comments on commit 7f5d1e1

Please sign in to comment.