Skip to content

Update for Konflux builds #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
FROM registry.access.redhat.com/ubi10/ubi-minimal:latest
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, fancy! 👏


# 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
Expand Down
15 changes: 13 additions & 2 deletions rhacmstackem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"'"}]'
Expand All @@ -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"
Expand Down