Skip to content
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
250 changes: 0 additions & 250 deletions .github/workflows/test-bundle-helpers.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions .tekton/operator-bundle-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ spec:
- name: prefetch-input
value: |
[
{ "type": "rpm", "path": "." },
{ "type": "gomod", "path": "." }
{ "type": "rpm", "path": "." }
]
- name: build-source-image
value: 'true'
Expand Down
38 changes: 11 additions & 27 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ CSV_VERSION ?= v$(VERSION)
# Set to empty string to echo some command lines which are hidden by default.
SILENT ?= @

# Python binary to use for bundle helpers. Can be overridden to use a specific version (e.g., python3.12).
# The Konflux build uses Python 3.12, so using python3.12 locally ensures compatibility.
# Python binary to use for bundle helpers. Can be overridden to use a specific version (e.g., python3.9).
# The Konflux build uses Python 3.9, so using python3.9 locally ensures compatibility.
PYTHON ?= python3

# This can be adjusted if deploying into non-standard namespaces. For example, as in
Expand Down Expand Up @@ -83,14 +83,6 @@ INDEX_IMG ?= $(INDEX_IMG_BASE):$(INDEX_IMG_TAG)
# Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):$(VERSION)

# RELATED_IMAGES_MODE controls how container image references are handled in the operator bundle CSV.
# Valid values:
# omit (default) - No related images in CSV (upstream builds)
# downstream - Inject RELATED_IMAGE_* env vars for Red Hat builds (no spec.relatedImages)
# konflux - Add explicit spec.relatedImages section for Konflux builds
# Used by bundle-post-process target to support image mirroring and disconnected environments.
RELATED_IMAGES_MODE ?= omit

# Set up the so-called "storage image" for executing scorecard test suite.
# By default a busybox image is pulled from docker.io. In order to rule out timing issues related to rate limiting
# we use our own copy of a busybox image from quay.io.
Expand Down Expand Up @@ -299,12 +291,8 @@ test-upgrade: kuttl bundle-post-process ## Run OLM-based operator upgrade tests.
.PHONY: test-bundle-helpers
test-bundle-helpers: ## Run Python unit tests against helper scripts.
set -euo pipefail ;\
if [ "$${USE_GO_BUNDLE_HELPER:-true}" != "true" ]; then \
$(ACTIVATE_PYTHON) ;\
pytest -v bundle_helpers ;\
else \
echo "Skipping Python tests (USE_GO_BUNDLE_HELPER=true)" ;\
fi
$(ACTIVATE_PYTHON) ;\
pytest -v bundle_helpers

.PHONY: stackrox-image-pull-secret
stackrox-image-pull-secret: ## Create default image pull secret for StackRox images on Quay.io. Used by Helm chart.
Expand Down Expand Up @@ -478,13 +466,11 @@ upgrade-dirty-tag-via-olm: kuttl
##@ Bundle and Index build

# Commands to enter local Python virtual environment and get needed dependencies there.
# We rely on the venv's default pip and setuptools, which are automatically compatible
# with the Python version used to create the venv:
# - Python 3.12 venvs come with pip/setuptools that handle Python 3.12 correctly
# - Older Python venvs come with pip/setuptools appropriate for those versions
# This avoids compatibility issues when trying to upgrade to specific pip versions.
# pip 21.3.1 and setuptools 59.6.0 use pkgutil.ImpImporter, removed in Python 3.12.
# The required Python version is tracked in bundle_helpers/.python-version.
ACTIVATE_PYTHON = $(PYTHON) -m venv bundle_helpers/.venv ;\
. bundle_helpers/.venv/bin/activate ;\
pip3 install --upgrade pip==21.3.1 setuptools==59.6.0 ;\
pip3 install -r bundle_helpers/requirements.txt

.PHONY: bundle
Expand Down Expand Up @@ -513,11 +499,10 @@ bundle: yq manifests kustomize operator-sdk ## Generate bundle manifests and met
# Yet we want most of the contents autogenerated from the Makefile variables as a single source of truth.
# Therefore we append ".extra" file to the end of bundle's dockerfile.
cat bundle.Dockerfile.extra >> bundle.Dockerfile
# Fix the orders in the specDescriptors (children must not appear before their parents).
# Note: Python venv is always needed because the Go implementation uses yaml-normalizer.py
# Run a python script to fix the orders in the specDescriptors (children must not appear before their parents).
set -euo pipefail ;\
$(ACTIVATE_PYTHON) ;\
./bundle_helpers/dispatch.sh fix-spec-descriptor-order \
bundle_helpers/fix-spec-descriptor-order.py \
<bundle/manifests/rhacs-operator.clusterserviceversion.yaml \
>bundle/manifests/rhacs-operator.clusterserviceversion.yaml.fixed
mv bundle/manifests/rhacs-operator.clusterserviceversion.yaml.fixed \
Expand All @@ -526,11 +511,10 @@ bundle: yq manifests kustomize operator-sdk ## Generate bundle manifests and met

.PHONY: bundle-post-process
bundle-post-process: test-bundle-helpers operator-sdk ## Post-process CSV file to include correct operator versions, etc.
# Note: Python venv is always needed because dispatch.sh may use yaml-normalizer.py
set -euo pipefail ;\
$(ACTIVATE_PYTHON) ;\
first_version=3.62.0 `# 3.62.0 is the first operator version ever released` ;\
candidate_version=$$(./bundle_helpers/dispatch.sh patch-csv \
candidate_version=$$(./bundle_helpers/patch-csv.py \
--use-version $(VERSION) \
--first-version $${first_version} \
--operator-image $(IMG) \
Expand All @@ -548,7 +532,7 @@ bundle-post-process: test-bundle-helpers operator-sdk ## Post-process CSV file t
--use-version=$(VERSION) \
--first-version=$${first_version} \
--operator-image=$(IMG) \
--related-images-mode=$(RELATED_IMAGES_MODE) \
--related-images-mode=omit \
$${unreleased_opt:-}
# Check that the resulting bundle still passes validations.
$(OPERATOR_SDK) bundle validate ./build/bundle --select-optional suite=operatorframework
Expand Down
Loading
Loading