Skip to content
Merged
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
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,6 @@ preflight: ## Run the OpenShift preflight tests against the Operator Image in a
--env KUBECONFIG=/kubeconfig/config \
--env PFLT_DOCKERCONFIG=/dockerconfig/$(PREFLIGHT_REGISTRY_AUTH_JSON) \
--env PFLT_LOGLEVEL=trace \
--env PFLT_CHANNEL=beta \
--env PFLT_LOGFILE=/artifacts/preflight.log \
-v $(BUILD_PREFLIGHT):/artifacts \
-v $(HOME)/.kube/:/kubeconfig:ro \
Expand Down
13 changes: 11 additions & 2 deletions hack/openshift/operator-cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,21 @@ LATEST_RELEASE=""
if [ "${USE_LATEST_OPERATOR_RELEASE}" = "true" ]; then
# delete the old local repo to force a new one to be cloned
rm -rf "${BUILD_DIR}/certified-operators"
# Use a proper name for git branch
GIT_CERT_BRANCH="release-${OPERATOR_VERSION}"
# Find the latest release of the Coherence Operator on GitHub
LATEST_RELEASE=$(gh release list --repo oracle/coherence-operator --json name,isLatest --jq '.[] | select(.isLatest)|.name')
# Strip the v from the front of the release to give the Operator version
OPERATOR_VERSION=${LATEST_RELEASE#"v"}
echo "Latest Operator version is ${OPERATOR_VERSION}"
# Check the latest release image exists on OCR
COHERENCE_OPERATOR_IMAGE="container-registry.oracle.com/middleware/coherence-operator:${OPERATOR_VERSION}"
echo "Checking Oracle Container Registry for image ${OCR_COHERENCE_IMAGE}"
podman manifest inspect "${OCR_COHERENCE_IMAGE}" > /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: Image ${OCR_COHERENCE_IMAGE} does not exist on OCR."
exit 1
fi
# Use a proper name for the git branch
GIT_CERT_BRANCH="release-${OPERATOR_VERSION}"
# Set the upstream repo for the pull request to be the official RedHat repo
UPSTREAM_REPO_NAME=redhat-openshift-ecosystem/certified-operators
# make sure the certified-operators repo in Coherence Community is sync'ed with the RedHat repo
Expand All @@ -184,6 +192,7 @@ else
OPERATOR_VERSION=$(cat "${BUILD_DIR}/_output/version.txt")
# We will not be submitting results
SUBMIT_RESULTS=false
COHERENCE_OPERATOR_IMAGE="${REGISTRY_HOST}/${REGISTRY_NAMESPACE}/coherence-operator:${OPERATOR_VERSION}"
fi

if [ -z "${OPERATOR_VERSION:-}" ]; then
Expand Down
58 changes: 58 additions & 0 deletions hack/openshift/run-preflight.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
#
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#

ROOT_DIR=$(pwd)
BUILD_DIR="${ROOT_DIR}/build"
OUTPUT_DIR="${BUILD_DIR}/_output"

mkdir -p "${OUTPUT_DIR}" || true

if [ -z "${SUBMIT_RESULTS:-}" ]; then
SUBMIT_RESULTS=false
fi

if [ "${SUBMIT_RESULTS}" = "true" ]; then
if [ -z "${OPENSHIFT_API_KEY:-}" ]; then
echo "Error: SUBMIT_RESULTS is set to 'true' but OPENSHIFT_API_KEY is not set"
exit 1
fi
if [ -z "${OPENSHIFT_IMAGE_COMPONENT_ID:-}" ]; then
OPENSHIFT_IMAGE_COMPONENT_ID="67bdf00eb9f79dcdb25aa8e2"
fi
EXTRA_ARGS="--pyxis-api-token=${OPENSHIFT_API_KEY} --certification-component-id=${OPENSHIFT_IMAGE_COMPONENT_ID}"
else
EXTRA_ARGS=""
fi

if [ "${USE_LATEST_OPERATOR_RELEASE}" = "true" ]; then
echo "Run preflight on latest release"
# Find the latest release of the Coherence Operator on GitHub
LATEST_RELEASE=$(gh release list --repo oracle/coherence-operator --json name,isLatest --jq '.[] | select(.isLatest)|.name')
# Strip the v from the front of the release to give the Operator version
OPERATOR_VERSION=${LATEST_RELEASE#"v"}
echo "Latest Operator version is ${OPERATOR_VERSION}"
# Check the latest release image exists on OCR
COHERENCE_OPERATOR_IMAGE="container-registry.oracle.com/middleware/coherence-operator:${OPERATOR_VERSION}"
echo "Checking Oracle Container Registry for image ${COHERENCE_OPERATOR_IMAGE}"
docker manifest inspect "${COHERENCE_OPERATOR_IMAGE}" > /dev/null
if [ $? -ne 0 ]; then
echo "ERROR: Image ${COHERENCE_OPERATOR_IMAGE} does not exist on OCR."
exit 1
fi
else
echo "Run preflight on latest build"
# We are just testing a local build, so use the current version
OPERATOR_VERSION=$(cat "${BUILD_DIR}/_output/version.txt")
# We will not be submitting results
SUBMIT_RESULTS=false
COHERENCE_OPERATOR_IMAGE="${REGISTRY_HOST}/${REGISTRY_NAMESPACE}/coherence-operator:${OPERATOR_VERSION}"
fi

echo "Running preflight on ${COHERENCE_OPERATOR_IMAGE}"

PREFLIGHT_LOG="${OUTPUT_DIR}/preflight.log"
preflight check container --submit="${SUBMIT_RESULTS}" --logfile="${PREFLIGHT_LOG}" ${EXTRA_ARGS} ${COHERENCE_OPERATOR_IMAGE}
Loading