Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/operator-installer/migrate_1.1_to_1.2.sh b/operator-installer/migrate_1.1_to_1.2.sh
- index 8859617..11f3df6 100755
- --- a/operator-installer/migrate_1.1_to_1.2.sh
- +++ b/operator-installer/migrate_1.1_to_1.2.sh
- @@ -82,7 +82,8 @@ if [[ $status == *"error"* ]]; then
- echo "$status" && exit 1
- fi
- -POSTGRESQL_PASSWORD=$(oc get deployment postgres -o=jsonpath={'.spec.template.spec.containers[0].env[?(@.name=="POSTGRESQL_PASSWORD")].value'} -n=$OPENSHIFT_PROJECT)
- +# POSTGRESQL_PASSWORD=$(oc get deployment postgres -o=jsonpath={'.spec.template.spec.containers[0].env[?(@.name=="POSTGRESQL_PASSWORD")].value'} -n=$OPENSHIFT_PROJECT)
- +POSTGRESQL_PASSWORD=$(oc get deployment keycloak -o=jsonpath={'.spec.template.spec.containers[0].env[?(@.name=="DB_PASSWORD")].value'} -n=$OPENSHIFT_PROJECT)
- SSO_ADMIN_USERNAME=$(oc get deployment keycloak -o=jsonpath={'.spec.template.spec.containers[0].env[?(@.name=="SSO_ADMIN_USERNAME")].value'} -n=$OPENSHIFT_PROJECT)
- SSO_ADMIN_PASSWORD=$(oc get deployment keycloak -o=jsonpath={'.spec.template.spec.containers[0].env[?(@.name=="SSO_ADMIN_PASSWORD")].value'} -n=$OPENSHIFT_PROJECT)
- SECRET=$(oc get oauthclient/openshift-identity-provider-h2fh -o=jsonpath={'.secret'})
- @@ -124,13 +125,48 @@ fi
- # update to latest defaults. Note that if using quay.io, operator is imply operator-rhel8; if using RHCC, it's server-operator-rhel8
- if [[ ${REGISTRY_PREFIX} == "quay.io/crw" ]]; then OPERATOR_CONTAINER="operator-rhel8"; else OPERATOR_CONTAINER="server-operator-rhel8"; fi
- +
- +PATCH_JSON=$(cat << EOF
- +{
- + "spec": {
- + "database": {
- + "postgresImage": "registry.redhat.io/rhscl/postgresql-96-rhel7:1-40"
- + },
- + "auth": {
- + "identityProviderPostgresPassword": "${REGISTRY_PREFIX}",
- + "identityProviderImage": "registry.redhat.io/redhat-sso-7/sso73-openshift:1.0-11",
- + "identityProviderPostgresPassword":"${POSTGRESQL_PASSWORD}"
- + },
- + "server": {
- + "cheImage":"${REGISTRY_PREFIX}/server-rhel8",
- + "cheImageTag":"1.2"
- + }
- + }
- +}
- +EOF
- +)
- +
- +echo "[INFO] Patching checluster CR with:"
- +echo ${PATCH_JSON}
- +echo "[INFO] Current checluster CR:"
- +oc get checluster codeready -o json
- +echo "[INFO] before patch ============"
- +oc patch checluster codeready -p "${PATCH_JSON}" --type merge -n ${OPENSHIFT_PROJECT}
- +echo $?
- +
- +echo "[INFO] Newly patched checluster CR:"
- +oc get checluster codeready -o json
- +
- oc set image deployment/codeready-operator *=${REGISTRY_PREFIX}/${OPERATOR_CONTAINER}:1.2 -n $OPENSHIFT_PROJECT
- echo "[INFO] Wait 30 seconds to complete rolling update..."; sleep 30s
- -oc patch checluster/codeready -p '{"spec":{"server":{"cheImage":"'${REGISTRY_PREFIX}'/server-rhel8"}}}' --type merge -n $OPENSHIFT_PROJECT
- -oc patch checluster/codeready -p '{"spec":{"server":{"cheImageTag":"1.2"}}}' --type merge -n $OPENSHIFT_PROJECT
- -oc patch checluster codeready -p '{"spec": {"auth":{"identityProviderImage":"registry.redhat.io/redhat-sso-7/sso73-openshift:1.0-11"}}}' --type merge -n $OPENSHIFT_PROJECT
- -oc patch checluster codeready -p '{"spec": {"auth":{"postgresImage":"registry.redhat.io/rhscl/postgresql-96-rhel7:1-40"}}}' --type merge -n $OPENSHIFT_PROJECT
- +echo "[INFO] Update postgre image"
- +oc set image deployment/postgres "*=registry.access.redhat.com/rhscl/postgresql-96-rhel7:1-40" -n codeready
- +
- +# oc patch checluster/codeready -p '{"spec":{"server":{"cheImage":"'${REGISTRY_PREFIX}'/server-rhel8"}}}' --type merge -n $OPENSHIFT_PROJECT
- +# oc patch checluster/codeready -p '{"spec":{"server":{"cheImageTag":"1.2"}}}' --type merge -n $OPENSHIFT_PROJECT
- +# oc patch checluster codeready -p '{"spec": {"auth":{"postgresImage":"registry.redhat.io/rhscl/postgresql-96-rhel7:1-40"}}}' --type merge -n $OPENSHIFT_PROJECT
- +# oc patch checluster codeready -p '{"spec": {"auth":{"keycloakPostgresPassword":"'${POSTGRESQL_PASSWORD}'"}}}' --type merge -n $OPENSHIFT_PROJECT
- echo "
- Successfully updated running deployment ${namespace}. Rolling update may take a few minutes to complete.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement