diff --git a/Dockerfile b/Dockerfile index f79cac6..dbd38ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM registry.access.redhat.com/ubi8/ubi-minimal:latest +FROM registry.access.redhat.com/ubi10/ubi-minimal:latest # Add RHACMStackEm script and YAML resources ADD rhacmstackem.sh . ADD resources/ resources/ # Install microdnf packages: tar/gzip, curl, git, jq, htpasswd -RUN microdnf update -y && microdnf install -y tar gzip curl git jq httpd-tools +RUN microdnf update -y && microdnf install -y tar gzip curl git jq httpd-tools skopeo # Install yq RUN curl -sLO https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64.tar.gz -o yq_linux_amd64.tar.gz && \ tar xzf yq_linux_amd64.tar.gz && chmod +x yq_linux_amd64 && mv yq_linux_amd64 /usr/local/bin/yq && rm yq_linux_amd64.tar.gz diff --git a/rhacmstackem.sh b/rhacmstackem.sh index b7c4a96..0fae486 100755 --- a/rhacmstackem.sh +++ b/rhacmstackem.sh @@ -109,7 +109,10 @@ if [[ "${ERROR_CODE}" != "1" ]]; then export KUBECONFIG=${LIFEGUARD_PATH}/clusterclaims/${CLUSTERCLAIM_NAME}/kubeconfig oc apply -f ./resources/consolenotification.yaml if [[ "${CONSOLE_BANNER_TEXT}" != "default" ]]; then - oc patch consolenotification.console.openshift.io/rhacmstackem --type json --patch '[{"op":"remove", "path":"/spec/link"},{"op":"replace", "path":"/spec/text", "value":"'"${CONSOLE_BANNER_TEXT}"'"}]' + if [[ "${PRESERVE_CONSOLE_BANNER_LINK}" != "true" ]]; then + oc patch consolenotification.console.openshift.io/rhacmstackem --type json --patch '[{"op":"remove", "path":"/spec/link"}' + fi + oc patch consolenotification.console.openshift.io/rhacmstackem --type json --patch '[{"op":"replace", "path":"/spec/text", "value":"'"${CONSOLE_BANNER_TEXT}"'"}]' fi if [[ -n "${CONSOLE_BANNER_COLOR}" ]]; then oc patch consolenotification.console.openshift.io/rhacmstackem --type json --patch '[{"op":"replace", "path":"/spec/color", "value":"'"${CONSOLE_BANNER_COLOR}"'"}]' @@ -135,7 +138,15 @@ if [[ -n "${SLACK_URL}" ]] || ( [[ -n "${SLACK_TOKEN}" ]] && [[ -n "${SLACK_CHAN GREETING=":mostly_sunny: Good Morning! Here's your \`${CLUSTERCLAIM_NAME}\` cluster for $(date "+%A, %B %d, %Y")" fi if [[ -n "${KUBECONFIG}" ]]; then - SNAPSHOT=$(oc get catalogsource acm-custom-registry -n openshift-marketplace -o jsonpath='{.spec.image}' | grep -o "[0-9]\+\..*SNAPSHOT.*$" || echo "(No snapshot found.)") + if [[ -z "${ACM_CATALOG_TAG}" ]]; then + SNAPSHOT=$(oc get catalogsource acm-custom-registry -n openshift-marketplace -o jsonpath='{.spec.image}' | grep -o "[0-9]\+\..*SNAPSHOT.*$" || echo "(No snapshot found.)") + else + echo "${QUAY_TOKEN}" | base64 -d > authfile.json + skopeo inspect "docker://quay.io/acm-d/acm-dev-catalog:${ACM_CATALOG_TAG}" --no-tags --authfile=authfile.json > inspect.json + cat inspect.json + SNAPSHOT=$(jq -r '.Labels."konflux.additional-tags"' inspect.json) + fi + RHACM_URL=$(oc get routes console -n openshift-console -o jsonpath='{.status.ingress[0].host}' || echo "(No RHACM route found.)") if [[ "${RHACM_URL}" != "(No RHACM route found.)" ]]; then RHACM_URL="https://${RHACM_URL}/multicloud/home/welcome"