diff --git a/hack/cluster-push-prep.sh b/hack/cluster-push-prep.sh index 13d3a99375..468bca788b 100755 --- a/hack/cluster-push-prep.sh +++ b/hack/cluster-push-prep.sh @@ -9,13 +9,17 @@ set -xeuo pipefail -oc -n openshift-cluster-version scale --replicas=0 deploy/cluster-version-operator +# XXX: --type merge completely overrides any previous "overrides" array +# find a way to just append? json op: add isn't working at all +# if there's not an overrides array already, that's why we use merge +oc patch clusterversions.config.openshift.io/version --type merge -p '{"spec":{"overrides": [{"kind": "Deployment","name": "machine-config-operator", "namespace": "openshift-machine-config-operator", "unmanaged": true}, {"kind": "ConfigMap","name": "machine-config-operator-images", "namespace": "openshift-machine-config-operator", "unmanaged": true}]}}' + if ! oc get -n openshift-image-registry route/image-registry &>/dev/null; then oc expose -n openshift-image-registry svc/image-registry fi oc patch -n openshift-image-registry route/image-registry -p '{"spec": {"tls": {"insecureEdgeTerminationPolicy": "Redirect", "termination": "reencrypt"}}}' registry=$(oc get -n openshift-image-registry -o json route/image-registry | jq -r ".spec.host") -if ! curl -k --head https://"${registry}" >/dev/null; then +if ! curl -k -s --head https://"${registry}" >/dev/null; then if ! grep -q "${registry}" /etc/hosts; then set +x echo "error: Failed to contact the registry" diff --git a/hack/cluster-push.sh b/hack/cluster-push.sh index 07294a6cfb..090a9e3545 100755 --- a/hack/cluster-push.sh +++ b/hack/cluster-push.sh @@ -14,7 +14,7 @@ if [ "${1:-}" = "-n" ]; then fi registry=$(oc get -n openshift-image-registry -o json route/image-registry | jq -r ".spec.host") -curl -k --head https://"${registry}" >/dev/null +curl -k -s --head https://"${registry}" >/dev/null WHAT=${WHAT:-machine-config-daemon} LOCAL_IMGNAME=localhost/${WHAT}