Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2b88073
dnm: test olmv1 deployment
weshayutin Apr 10, 2026
76f9c16
fix unit tests
weshayutin Apr 13, 2026
ac16803
update lint
weshayutin Apr 13, 2026
565e178
Enhance OLMv1 migration support: update service account naming, add m…
kaovilai May 5, 2026
8285756
Add OLMv0 remnant cleanup and CatalogSource migration to OLMv1 tests
kaovilai May 7, 2026
5234080
Add olm.managed=true cleanup to Makefile migration target
kaovilai May 7, 2026
f9cfb45
Add CI compatibility, version verification, and docs for OLMv1 migrat…
kaovilai May 7, 2026
9de0e76
Add generated OLMv1 manifest to .gitignore
kaovilai May 7, 2026
d30d922
Address review feedback: fix manifest schema, scope cleanup, add mirr…
kaovilai May 7, 2026
da78e23
fix: replace xargs -r with portable POSIX alternative in Makefile
kaovilai May 11, 2026
c8ccff9
fix: handle List errors in Eventually closures to prevent nil deref
kaovilai May 11, 2026
87a3e6e
fix: log List errors in OLMv0 remnant cleanup instead of discarding
kaovilai May 11, 2026
4cab1a0
fix: set createdCatalog flag when existing ClusterCatalog matches image
kaovilai May 11, 2026
929711e
fix: wait for CRD deletion to complete before proceeding
kaovilai May 11, 2026
8d1fb17
fix: delete existing ClusterExtension before Create for rerun safety
kaovilai May 11, 2026
3cc3733
fix: pin catalog selector in migration path when catalog is auto-dete…
kaovilai May 11, 2026
698fcc2
fix: log when ClusterCatalog has no conditions yet during wait
kaovilai May 12, 2026
8cd05a8
fix: default OLMv1 test targets to ttl.sh with auto-build
kaovilai May 12, 2026
05d8104
fix: default OLMV1_VERSION to VERSION (99.0.0)
kaovilai May 12, 2026
04564d0
fix: echo OLMv1 test configuration before running
kaovilai May 12, 2026
ba5487d
fix: skip OLMv1 tests when cluster lacks prerequisites
kaovilai May 13, 2026
16fb09e
fix: check NewOLMOwnSingleNamespace feature gate before running tests
kaovilai May 13, 2026
c62bcbd
fix: support CustomNoUpgrade as alternative to TechPreviewNoUpgrade
kaovilai May 14, 2026
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: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ linters:
- third_party$
- builtin$
- examples$
- tests/olmv1
issues:
max-issues-per-linter: 0
max-same-issues: 0
Expand Down
139 changes: 138 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ vet: check-go ## Run go vet against code.
.PHONY: test
test: check-go vet envtest ## Run unit tests; run Go linters checks; check if api and bundle folders are up to date; and check if go dependencies are valid
@make versions
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -mod=mod $(shell go list -mod=mod ./... | grep -v /tests/e2e) -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -mod=mod $(shell go list -mod=mod ./... | grep -v /tests/e2e | grep -v /tests/olmv1) -coverprofile cover.out
@make lint
@make api-isupdated
@make bundle-isupdated
Expand Down Expand Up @@ -1017,6 +1017,143 @@ test-e2e-cleanup: login-required
$(OC_CLI) delete ns mysql-persistent --ignore-not-found=true
rm -rf $(SETTINGS_TMP)

##@ OLMv1 Tests

OLMV1_PACKAGE ?= oadp-operator
OLMV1_NAMESPACE ?= $(OADP_TEST_NAMESPACE)
OLMV1_CHANNEL ?=
OLMV1_VERSION ?=
OLMV1_UPGRADE_VERSION ?=
OLMV1_CATALOG ?= oadp-olmv1-test-catalog
OLMV1_CATALOG_IMAGE ?=
OLMV1_SERVICE_ACCOUNT ?= $(OLMV1_PACKAGE)-installer
OLMV1_INSTALLER_BINDING ?= $(OLMV1_SERVICE_ACCOUNT)-binding
OLMV1_FAIL_FAST ?= true

OLMV1_GINKGO_FLAGS = --vv \
--no-color=$(OPENSHIFT_CI) \
--label-filter="olmv1" \
--junit-report="$(ARTIFACT_DIR)/junit_olmv1_report.xml" \
--fail-fast=$(OLMV1_FAIL_FAST) \
--timeout=30m

.PHONY: test-olmv1
test-olmv1: login-required install-ginkgo ## Run OLMv1 lifecycle tests (install, verify, upgrade, cleanup) against a cluster with OLMv1 enabled.
ginkgo run -mod=mod $(OLMV1_GINKGO_FLAGS) $(GINKGO_ARGS) tests/olmv1/ -- \
-namespace=$(OLMV1_NAMESPACE) \
-package=$(OLMV1_PACKAGE) \
-channel=$(OLMV1_CHANNEL) \
-version=$(OLMV1_VERSION) \
-upgrade-version=$(OLMV1_UPGRADE_VERSION) \
-catalog=$(OLMV1_CATALOG) \
-catalog-image=$(OLMV1_CATALOG_IMAGE) \
-service-account=$(OLMV1_SERVICE_ACCOUNT) \
-artifact_dir=$(ARTIFACT_DIR)

.PHONY: test-olmv1-cleanup
test-olmv1-cleanup: login-required ## Cleanup resources created by OLMv1 tests.
$(OC_CLI) delete clusterextension $(OLMV1_PACKAGE) --ignore-not-found=true
$(OC_CLI) delete clustercatalog $(OLMV1_CATALOG) --ignore-not-found=true
$(OC_CLI) delete clusterrolebinding $(OLMV1_INSTALLER_BINDING) --ignore-not-found=true
$(OC_CLI) delete sa $(OLMV1_SERVICE_ACCOUNT) -n $(OLMV1_NAMESPACE) --ignore-not-found=true
Comment thread
weshayutin marked this conversation as resolved.

OLMV1_MANIFEST ?= oadp-olmv1-manifest.yaml

.PHONY: generate-olmv1-manifest
generate-olmv1-manifest: ## Generate OLMv1 install manifest (Namespace, SA, CRB, ClusterExtension) per OCPSTRAT-2268 template.
@printf '%s\n' \
'---' \
'apiVersion: v1' \
'kind: Namespace' \
'metadata:' \
' name: $(OLMV1_NAMESPACE)' \
'---' \
'apiVersion: v1' \
'kind: ServiceAccount' \
'metadata:' \
' name: $(OLMV1_SERVICE_ACCOUNT)' \
' namespace: $(OLMV1_NAMESPACE)' \
'---' \
'apiVersion: rbac.authorization.k8s.io/v1' \
'kind: ClusterRoleBinding' \
'metadata:' \
' name: $(OLMV1_INSTALLER_BINDING)' \
'roleRef:' \
' apiGroup: rbac.authorization.k8s.io' \
' kind: ClusterRole' \
' name: cluster-admin' \
'subjects:' \
'- kind: ServiceAccount' \
' name: $(OLMV1_SERVICE_ACCOUNT)' \
' namespace: $(OLMV1_NAMESPACE)' \
'---' \
'apiVersion: olm.operatorframework.io/v1' \
'kind: ClusterExtension' \
'metadata:' \
' name: $(OLMV1_PACKAGE)' \
'spec:' \
' namespace: $(OLMV1_NAMESPACE)' \
' serviceAccount:' \
' name: $(OLMV1_SERVICE_ACCOUNT)' \
' config:' \
' configType: Inline' \
' inline:' \
' watchNamespace: $(OLMV1_NAMESPACE)' \
' source:' \
' sourceType: Catalog' \
' catalog:' \
' packageName: $(OLMV1_PACKAGE)' \
> $(OLMV1_MANIFEST)
@if [ -n "$(OLMV1_CHANNEL)" ]; then \
printf ' channel: %s\n' '$(OLMV1_CHANNEL)' >> $(OLMV1_MANIFEST); \
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.
@if [ -n "$(OLMV1_VERSION)" ]; then \
printf ' version: "%s"\n' '$(OLMV1_VERSION)' >> $(OLMV1_MANIFEST); \
fi
@echo "Generated $(OLMV1_MANIFEST)"

.PHONY: upgrade-v0-to-olmv1
upgrade-v0-to-olmv1: login-required ## Migrate an existing OLMv0 OADP install to OLMv1 (ClusterExtension). Requires OCP 4.20+.
$(OC_CLI) whoami
@echo "=== Phase 1: Removing OLMv0 resources ==="
-$(OC_CLI) delete subscription oadp-operator -n $(OADP_TEST_NAMESPACE) --ignore-not-found=true
-$(OC_CLI) get subscription -n $(OADP_TEST_NAMESPACE) -o name 2>/dev/null | \
xargs -I {} sh -c '$(OC_CLI) get {} -n $(OADP_TEST_NAMESPACE) -o jsonpath='"'"'{.metadata.name}{"\t"}{.spec.source}{"\n"}'"'"' 2>/dev/null' | \
grep "$(CATALOG_SOURCE_NAME)" | cut -f1 | \
xargs -I {} $(OC_CLI) delete subscription {} -n $(OADP_TEST_NAMESPACE) --ignore-not-found=true || true
-$(OC_CLI) delete csv -l operators.coreos.com/oadp-operator.$(OADP_TEST_NAMESPACE) -n $(OADP_TEST_NAMESPACE) --ignore-not-found=true
-$(OC_CLI) get csv -n $(OADP_TEST_NAMESPACE) -o name 2>/dev/null | grep oadp-operator | \
xargs -I {} $(OC_CLI) delete {} -n $(OADP_TEST_NAMESPACE) --ignore-not-found=true || true
-$(OC_CLI) delete operatorgroup oadp-operator-group -n $(OADP_TEST_NAMESPACE) --ignore-not-found=true
-$(OC_CLI) delete catalogsource $(CATALOG_SOURCE_NAME) -n $(CATALOG_SOURCE_NAMESPACE) --ignore-not-found=true
@echo "=== Phase 2: Removing orphaned OADP/Velero CRDs ==="
# OLMv1 cannot adopt CRDs it did not create
-$(OC_CLI) get crd -o name 2>/dev/null | grep -E '\.oadp\.openshift\.io|\.velero\.io' | \
Comment thread
kaovilai marked this conversation as resolved.
Outdated
xargs -r $(OC_CLI) delete --ignore-not-found=true || true
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
@echo "=== Phase 3: Applying OLMv1 manifest ==="
$(MAKE) generate-olmv1-manifest
$(OC_CLI) apply -f $(OLMV1_MANIFEST)
@echo "=== Phase 4: Waiting for ClusterExtension Installed=True ==="
$(OC_CLI) wait clusterextension/$(OLMV1_PACKAGE) \
--for=condition=Installed=True --timeout=600s
@echo "Migration complete."
$(OC_CLI) get clusterextension $(OLMV1_PACKAGE)

.PHONY: test-upgrade-v0-to-olmv1
test-upgrade-v0-to-olmv1: login-required install-ginkgo ## Test OLMv0->OLMv1 migration path. Expects a pre-existing OLMv0 OADP install (run make deploy-olm first).
ginkgo run -mod=mod $(OLMV1_GINKGO_FLAGS) \
--label-filter="olmv1-migrate" \
$(GINKGO_ARGS) tests/olmv1/ -- \
-namespace=$(OLMV1_NAMESPACE) \
-package=$(OLMV1_PACKAGE) \
-channel=$(OLMV1_CHANNEL) \
-version=$(OLMV1_VERSION) \
-catalog=$(OLMV1_CATALOG) \
-catalog-image=$(OLMV1_CATALOG_IMAGE) \
-service-account=$(OLMV1_SERVICE_ACCOUNT) \
-migrate=true \
-artifact_dir=$(ARTIFACT_DIR)

.PHONY: update-non-admin-manifests
update-non-admin-manifests: NON_ADMIN_CONTROLLER_IMG?=quay.io/konveyor/oadp-non-admin:latest
update-non-admin-manifests: yq ## Update Non Admin Controller (NAC) manifests shipped with OADP, from NON_ADMIN_CONTROLLER_PATH
Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/oadp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1639,7 +1639,7 @@ spec:
installModes:
- supported: true
type: OwnNamespace
- supported: false
- supported: true
Comment thread
kaovilai marked this conversation as resolved.
type: SingleNamespace
- supported: false
type: MultiNamespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ spec:
installModes:
- supported: true
type: OwnNamespace
- supported: false
- supported: true
type: SingleNamespace
- supported: false
type: MultiNamespace
Expand Down
1 change: 1 addition & 0 deletions tests/olmv1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tmp/
Loading