Skip to content

Commit

Permalink
Try annotating hostedcluster instead of patching application deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
  • Loading branch information
tiraboschi committed Feb 14, 2024
1 parent 43686c2 commit 3dd18c4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ PULL_SECRET_PATH="/tmp/.dockerconfigjson"
TRUST="--additional-trust-bundle /etc/pki/ca-trust/source/anchors/registry.2.crt "
# TODO: can we avoid this?
ROVERRIDES=\$(oc get imagecontentsourcepolicy image-policy -o=json | jq -r '.spec.repositoryDigestMirrors[] | select (.source | test("registry.ci.openshift.org/ocp/") ) | .source+"="+.mirrors[0]')
oc patch deploy -n hypershift operator --type=json -p="[{\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/args/-\", \"value\": \"--registry-overrides=\${ROVERRIDES}\"}]"
sleep 30
#ROVERRIDES=\$(oc get imagecontentsourcepolicy image-policy -o=json | jq -r '.spec.repositoryDigestMirrors[] | select (.source | test("registry.ci.openshift.org/ocp/") ) | .source+"="+.mirrors[0]')
#oc patch deploy -n hypershift operator --type=json -p="[{\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/args/-\", \"value\": \"--registry-overrides=\${ROVERRIDES}\"}]"
#sleep 30
###
HO_OPERATOR_IMAGE="\${PAYLOADIMAGE//@sha256:[^ ]*/@\$(oc adm release info -a /tmp/.dockerconfigjson "\$PAYLOADIMAGE" | grep hypershift | awk '{print \$2}')}"
ETCD_STORAGE_CLASS=""
if [ "\$(oc get infrastructure cluster -o=jsonpath='{.status.platformStatus.type}')" == "AWS" ]; then
echo "AWS infra detected. Setting --etcd-storage-class"
Expand All @@ -106,6 +108,7 @@ fi
echo "\$(date) Creating HyperShift cluster \${CLUSTER_NAME}"
/tmp/hcp create cluster kubevirt \${ETCD_STORAGE_CLASS} \${ICSP} \${TRUST} \
--annotations=hypershift.openshift.io/control-plane-operator-image=\${HO_OPERATOR_IMAGE} \
--name \${CLUSTER_NAME} \
--node-pool-replicas \${HYPERSHIFT_NODE_COUNT} \
--memory 16Gi \
Expand Down

0 comments on commit 3dd18c4

Please sign in to comment.