Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion .github/workflows/pr-container-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ env:
OPM_SHA256: b81b337baf851698a96b70fc5d419b6f239a8856c4f598df65b225d56c39fff6
# OLM catalog constants (must match the rhdh profile in the Makefile)
BUNDLE_METADATA_PACKAGE_NAME: rhdh
DEFAULT_CHANNEL: fast
PROFILE_SHORT: rhdh

concurrency:
Expand Down Expand Up @@ -177,6 +176,7 @@ jobs:
echo "SAFE_SHORT_SHA=${TRUSTED_SHORT_SHA}" >> "$GITHUB_ENV"
echo "SAFE_FULL_TAG=${FULL_TAG}" >> "$GITHUB_ENV"
echo "SAFE_ALIAS_TAG=${ALIAS_TAG}" >> "$GITHUB_ENV"
echo "DEFAULT_CHANNEL=fast-$(echo "${BASE_VERSION}" | cut -d. -f1,2)" >> "$GITHUB_ENV"
echo "EXPIRATION_TIMESTAMP=$(date -u -d '+7 days' +%s)" >> "$GITHUB_ENV"

- name: Load operator image
Expand Down
8 changes: 6 additions & 2 deletions .rhdh/scripts/install-rhdh-catalog-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ NC='\033[0m'
IS_OPENSHIFT=""

NAMESPACE_SUBSCRIPTION="rhdh-operator"
OLM_CHANNEL="fast"
if [[ -n "${CI_X_VERSION:-}" && -n "${CI_Y_VERSION:-}" ]]; then
OLM_CHANNEL="fast-${CI_X_VERSION}.${CI_Y_VERSION}"
else
OLM_CHANNEL="${OLM_CHANNEL:-fast}"
Comment thread
rm3l marked this conversation as resolved.
Resolved
fi
UPSTREAM_IIB_OVERRIDE=""
INSTALL_PLAN_APPROVAL="Automatic"
OLM_VERSION="auto"
Expand Down Expand Up @@ -60,7 +64,7 @@ as a catalog source. On OLM v0, a CatalogSource is created in 'openshift-marketp
a ClusterCatalog is created (cluster-scoped); when --install-operator is also provided, a ClusterExtension, ServiceAccount, and
ClusterRoleBinding are created in the '${NAMESPACE_SUBSCRIPTION}' namespace. By default, the OLM version is auto-detected based on
the presence of the ClusterExtension CRD. When installing an operator, the script waits for readiness before exiting successfully.
The default catalog/resource name is 'operatorName-channelName' (eg., rhdh-fast).
The default catalog/resource name is 'operatorName-channelName' (eg., rhdh-fast-2.1).

If IIB installation fails, see https://docs.engineering.redhat.com/display/CFC/Test and
follow steps in section 'Adding Brew Pull Secret'
Expand Down
16 changes: 11 additions & 5 deletions .rhdh/scripts/prepare-restricted-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,6 @@ function render_index() {
"$YQ" 'select(
(.schema == "olm.package" and .name == "'${prod_operator_package_name}'")
or
(.schema == "olm.channel" and .package == "'${prod_operator_package_name}'" and .name == "fast")
or
'"$chanFilterList"'
or
'"$bundleFilterList"'
Expand Down Expand Up @@ -1545,7 +1543,6 @@ EOF
if [[ "${NO_VERSION_FILTER}" != "true" ]]; then
cat <<EOF >>"${TMPDIR}/imageset-config.yaml"
channels:
- name: fast
EOF
for v in "${FILTERED_VERSIONS[@]}"; do
cat <<EOF >>"${TMPDIR}/imageset-config.yaml"
Expand Down Expand Up @@ -1958,6 +1955,15 @@ if [[ -z "${TO_REGISTRY}" ]] && [[ "${OLM_VERSION}" == "auto" ]]; then
infof "Generating both OLM v0 and v1 manifest templates for export."
fi

# Compute the OLM channel for generated manifests
if [[ "${NO_VERSION_FILTER}" != "true" && ${#FILTERED_VERSIONS[@]} -gt 0 && "${FILTERED_VERSIONS[0]}" != "*" ]]; then
OLM_CHANNEL_NAME="fast-${FILTERED_VERSIONS[-1]}"
elif [[ -n "${CI_X_VERSION:-}" && -n "${CI_Y_VERSION:-}" ]]; then
OLM_CHANNEL_NAME="fast-${CI_X_VERSION}.${CI_Y_VERSION}"
else
OLM_CHANNEL_NAME="${OLM_CHANNEL_NAME:-fast}"
Comment thread
rm3l marked this conversation as resolved.
Resolved
fi

if should_generate_v1_manifests; then
# shellcheck disable=SC2016
SA_NAME='${SA_NAME}'
Expand Down Expand Up @@ -2101,7 +2107,7 @@ spec:
catalog:
packageName: rhdh
channels:
- fast
- ${OLM_CHANNEL_NAME}
selector:
matchLabels:
olm.operatorframework.io/metadata.name: ${TARGET_CATALOG}
Expand All @@ -2124,7 +2130,7 @@ metadata:
name: rhdh-operator
namespace: ${NAMESPACE_OPERATOR}
spec:
channel: fast
channel: ${OLM_CHANNEL_NAME}
installPlanApproval: Automatic
name: rhdh
source: ${TARGET_CATALOG}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ ifeq ($(PROFILE), rhdh)
# TODO: Changed to 'rhdh-community' at least until 'rhdh' does not support arm64
# IMAGE_TAG_BASE ?= registry.redhat.io/rhdh/rhdh-rhel9-operator
IMAGE_TAG_BASE ?= quay.io/rhdh-community/operator
DEFAULT_CHANNEL ?= fast
CHANNELS ?= fast,fast-\$${CI_X_VERSION}.\$${CI_Y_VERSION}
DEFAULT_CHANNEL ?= fast-\$${CI_X_VERSION}.\$${CI_Y_VERSION}
CHANNELS ?= fast-\$${CI_X_VERSION}.\$${CI_Y_VERSION}
BUNDLE_METADATA_PACKAGE_NAME ?= rhdh
CATALOG_INDEX_IMAGE ?= quay.io/rhdh/plugin-catalog-index:$(IMAGE_TAG_VERSION)
else
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bundle/rhdh/bundle.Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bundle/rhdh/metadata/annotations.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ metadata:
operatorframework.io/suggested-namespace: rhdh-operator
operators.openshift.io/valid-subscription: '["Red Hat Developer Hub"]'
repository: https://gitlab.cee.redhat.com/rhidp/rhdh/
skipRange: '>=1.0.0 <2.1.0'
skipRange: '>=1.10.0 <2.1.0'
Comment thread
rm3l marked this conversation as resolved.
Resolved
support: Red Hat
labels:
operatorframework.io/arch.amd64: supported
Expand Down
22 changes: 19 additions & 3 deletions tests/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ func installRhdhOperatorAirgapped() (podLabel string) {
_, err := helper.Run(cmd)
ExpectWithOffset(1, err).NotTo(HaveOccurred())

// Derive the OLM channel from the operator version (e.g., v2.1.0 -> fast-2.1)
verParts := strings.SplitN(strings.TrimPrefix(operatorVersion, "v"), ".", 3)
olmChannel := fmt.Sprintf("fast-%s.%s", verParts[0], verParts[1])

// Create a subscription in the rhdh-operator namespace
helper.CreateNamespace(_namespace)
cmd = exec.Command(helper.GetPlatformTool(), "-n", _namespace, "apply", "-f", "-")
Expand All @@ -114,12 +118,12 @@ metadata:
name: rhdh
namespace: %s
spec:
channel: fast
channel: %s
installPlanApproval: Automatic
name: rhdh
source: rhdh-disconnected-install
sourceNamespace: openshift-marketplace
`, _namespace))
`, _namespace, olmChannel))
}()
_, err = helper.Run(cmd)
ExpectWithOffset(1, err).NotTo(HaveOccurred())
Expand Down Expand Up @@ -351,9 +355,21 @@ func uninstallRhdhOperator(withAirgap bool) {
_, err := helper.Run(cmd)
ExpectWithOffset(1, err).NotTo(HaveOccurred())

cs := "rhdh-fast"
var cs string
if withAirgap {
cs = "rhdh-disconnected-install"
} else {
olmChannel := os.Getenv("OLM_CHANNEL")
if olmChannel == "" {
xVer := os.Getenv("CI_X_VERSION")
yVer := os.Getenv("CI_Y_VERSION")
if xVer != "" && yVer != "" {
olmChannel = fmt.Sprintf("fast-%s.%s", xVer, yVer)
} else {
olmChannel = "fast"
}
}
cs = "rhdh-" + olmChannel
}
cmd = exec.Command(
helper.GetPlatformTool(), "delete", "catalogsource", cs,
Expand Down
Loading