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
16 changes: 5 additions & 11 deletions .github/workflows/migration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,16 @@ jobs:
timeout-minutes: 90
env:
E2E_FIXTURE_CLUSTER_NAME: library-olm-cod-e2e
E2E_FIXTURE_KUBECONFIG: ${{ github.workspace }}/operator-controller/.kubeconfig/library-olm-cod-e2e.kubeconfig
E2E_FIXTURE_KUBECONFIG: ${{ github.workspace }}/.kubeconfig/library-olm-cod-e2e.kubeconfig
E2E_COVERAGE_DIR: ${{ github.workspace }}/artifacts/e2e/coverage/cod
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/checkout@v7
with:
repository: operator-framework/operator-controller
ref: 77754d81ea0125d3a850e9fa57decf7a7255a409
path: operator-controller
persist-credentials: false
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Build and deploy pinned COD-capable controller
run: make -C operator-controller run-experimental KIND_CLUSTER_NAME=library-olm-cod-e2e K8S_VERSION=1.37
- name: Install committed OLMv0 fixtures and catalog
- name: Install pinned controller, OLMv0 APIs, and fixture catalog
run: make migration/e2e-fixture-setup
- name: Verify COD handoff and catalog revision
run: make migration/test-e2e-cos-supersession
Expand Down Expand Up @@ -148,7 +140,9 @@ jobs:
with:
go-version-file: go.mod
- name: Run in-cluster migration Job test
run: make migration/test-e2e-in-cluster-job
run: |
make migration/e2e-fixture-setup
make migration/test-e2e-in-cluster-job
- name: Tear down fixture cluster
if: always()
run: E2E_CLUSTER_NAME=library-olm-fixture-e2e make migration/e2e-teardown
Expand Down
16 changes: 9 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ require (
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1
github.com/operator-framework/api v0.46.0
github.com/operator-framework/operator-controller v1.12.1-0.20261106151730-77754d81ea01
github.com/operator-framework/operator-controller v1.12.1-0.20261111152305-9dd683afa190
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.12.1
go.podman.io/image/v5 v5.42.0
golang.org/x/sync v0.25.0
helm.sh/helm/v4 v4.3.1
k8s.io/api v0.37.1
k8s.io/api v0.37.2
k8s.io/apiextensions-apiserver v0.37.1
k8s.io/apimachinery v0.37.1
k8s.io/client-go v0.37.1
k8s.io/apimachinery v0.37.2
k8s.io/client-go v0.37.2
k8s.io/utils v0.0.0-20260626114624-be93311217bd
oras.land/oras-go/v2 v2.7.0
sigs.k8s.io/controller-runtime v0.25.2
Expand Down Expand Up @@ -77,6 +77,7 @@ require (
github.com/google/go-containerregistry v0.22.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20240805132620-81f5be970eca // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -96,13 +97,14 @@ require (
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/runtime-spec v1.3.0 // indirect
github.com/pandatix/go-abnf v0.5.1 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/proglottis/gpgme v0.1.6 // indirect
github.com/prometheus/client_golang v1.25.0 // indirect
github.com/prometheus/client_model v0.6.3 // indirect
github.com/prometheus/common v0.72.1 // indirect
github.com/prometheus/common v0.73.0 // indirect
github.com/prometheus/procfs v0.22.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.11.1 // indirect
Expand Down Expand Up @@ -136,10 +138,10 @@ require (
google.golang.org/protobuf v1.36.12 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/cli-runtime v0.37.1 // indirect
k8s.io/cli-runtime v0.37.2 // indirect
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect
k8s.io/streaming v0.37.1 // indirect
k8s.io/streaming v0.37.2 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/kustomize/api v0.21.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.21.2 // indirect
Expand Down
40 changes: 22 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5T
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
github.com/hashicorp/golang-lru/arc/v2 v2.0.5 h1:l2zaLDubNhW4XO3LnliVj0GXO3+/CGNJAg1dcN2Fpfw=
github.com/hashicorp/golang-lru/arc/v2 v2.0.5/go.mod h1:ny6zBSQZi2JxIeYcv7kt2sH2PXJtirBN7RDhRpxPkxU=
Expand Down Expand Up @@ -263,8 +265,10 @@ github.com/opencontainers/runtime-spec v1.3.0 h1:YZupQUdctfhpZy3TM39nN9Ika5CBWT5
github.com/opencontainers/runtime-spec v1.3.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/operator-framework/api v0.46.0 h1:EitSlfRJZKYDewTK+ntH9L/p+NIKv/L1PgRoaIWH+to=
github.com/operator-framework/api v0.46.0/go.mod h1:oFXzh7rHCnMwC6N0B92NEsfQyLGJ7FrceAYemjwoKPI=
github.com/operator-framework/operator-controller v1.12.1-0.20261106151730-77754d81ea01 h1:WD3OW21Z7b1lz6I5CGgDkZ2ljZlmgQ/kt3bStqEGjno=
github.com/operator-framework/operator-controller v1.12.1-0.20261106151730-77754d81ea01/go.mod h1:9H3hReMjs2wU5XRaFj2GT1hJMNzKtNpgQFuAm6/sBgc=
github.com/operator-framework/operator-controller v1.12.1-0.20261111152305-9dd683afa190 h1:Ei8X96MuWB44u6rQLTD3hEjrglf0XLBHh+S58gfrv5U=
github.com/operator-framework/operator-controller v1.12.1-0.20261111152305-9dd683afa190/go.mod h1:v1y3MkrEMhVlaqqlixF0jwIseBxQvOc06hAreXMWLmQ=
github.com/pandatix/go-abnf v0.5.1 h1:iyLvSu2Aq12iE0r4n948Qw21BHDuckLq/8WIXAAF+HI=
github.com/pandatix/go-abnf v0.5.1/go.mod h1:VBmbtpFgQNEaQpyAvmi+Ecd9wAYJKzA3TmiB3L93sVg=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand All @@ -279,8 +283,8 @@ github.com/prometheus/client_golang v1.25.0/go.mod h1:j2X/4/kaQHLPnmyEU8zjmkndo1
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo=
github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM=
github.com/prometheus/common v0.72.1 h1:ZAiQed/nk8IIcsdzb2TlJu23NEUDyDLQ9TXTN2WRK6Y=
github.com/prometheus/common v0.72.1/go.mod h1:1IoBY4IRaJnhs2ESjNzjilP1cJ/P8pimGoomq7zRXrA=
github.com/prometheus/common v0.73.0 h1:NGIOmVi8jrgiiPQgXxD6rP0FfxFsuZxnMQkel0qBy/g=
github.com/prometheus/common v0.73.0/go.mod h1:Nt+CsVkf/mj4wDAmtSwq1HTPohHSX6fMr6+/f9B5UqM=
github.com/prometheus/otlptranslator v1.0.0 h1:s0LJW/iN9dkIH+EnhiD3BlkkP5QVIUVEoIwkU+A6qos=
github.com/prometheus/otlptranslator v1.0.0/go.mod h1:vRYWnXvI6aWGpsdY/mOT/cbeVRBlPWtBNDb7kGR3uKM=
github.com/prometheus/procfs v0.22.0 h1:6q9+/JL9IKAPbCmBrv9n5O5Ty3NKnciV5X7YGw0oics=
Expand Down Expand Up @@ -490,26 +494,26 @@ helm.sh/helm/v4 v4.3.1 h1:UndCoLe9UPmNoL7IvWzaUXveL7T5t/ijoorEmgJdI9g=
helm.sh/helm/v4 v4.3.1/go.mod h1:Z663D/wNQG1UsG3X7svSEBPvosFVel4SIw4YIMZwmuY=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.37.1 h1:l6N77U7tjwB5L056bgrBTJIEdevac/naBZ3iSvDNfpM=
k8s.io/api v0.37.1/go.mod h1:zSlbB1YpJ1YQlFVQy20UYll81UJSJJUMLhkhvg6Z78M=
k8s.io/api v0.37.2 h1:PnxqnUFy93jr2GcpWDkKOm8wfy25kT9wa572MuQS8oc=
k8s.io/api v0.37.2/go.mod h1:+NVRLft99kx+Jg9v34GmHw867Dapim89TSyCsn2hK+M=
k8s.io/apiextensions-apiserver v0.37.1 h1:7fIQG8eThDSTVYBWg/DOpI8v5wYfKCo0N8/TDMjj+zY=
k8s.io/apiextensions-apiserver v0.37.1/go.mod h1:1Q3ujWwHgnhBoGsdmGORflwK1sDFmuaqH1OsMDWk2Gs=
k8s.io/apimachinery v0.37.1 h1:hGCYyvKHCwtwMitj2vU4vYx0Z16N9GyZk9BBnz0wDAE=
k8s.io/apimachinery v0.37.1/go.mod h1:jF84AyUi/IRIXRot5f+lm6MpxoWI+F1XgjaMmwCdTFw=
k8s.io/apiserver v0.37.1 h1:dUsNwjsvItyVKNpC1N0AhQ0OBSiUJKfWz004vPifOe0=
k8s.io/apiserver v0.37.1/go.mod h1:EWXW6PntGfOC2uD9GGVobnOExgFoX1z0hZo7f7Rs7Ng=
k8s.io/cli-runtime v0.37.1 h1:3mir5bM4XjMJHW3SMRk++3Ylf4YQne0XFFsW+IGT85U=
k8s.io/cli-runtime v0.37.1/go.mod h1:g3VQOm71f//aNbp79g0az9jBRTrvPjAHz7WxVysbZ4M=
k8s.io/client-go v0.37.1 h1:QTv/5ha4jAHtW9qxxVBkQVFBRDb4jHfFopQqqMdc+wM=
k8s.io/client-go v0.37.1/go.mod h1:dnAPtTnCNY38Ho04D2KdY1F4IKausa9UbqaAZKl60SY=
k8s.io/component-base v0.37.1 h1:93DMmlENnK7gNLkL4pMqLO5M/HVf3p3sM4q/GasLveY=
k8s.io/component-base v0.37.1/go.mod h1:bBrdziT4dreQG5lzTaPVxBwsZe1oxphG+ZVdD56dQWQ=
k8s.io/apimachinery v0.37.2 h1:G4t9RGoPDbQML38hz/kQQiltttgd3egg2ODCR8aIc2o=
k8s.io/apimachinery v0.37.2/go.mod h1:qaAvSNvgU2x07wRM95MSHSJTPQ/ob/LeNAGbeDgqQJg=
k8s.io/apiserver v0.37.2 h1:9Jq73PeHAA0RThpW7ou6lBcO2+SxLcPrAgleONSMUNQ=
k8s.io/apiserver v0.37.2/go.mod h1:d0P4WZtt6XMYAo6VN8dDPRnvY3O34quI3pOuxtfgAgM=
k8s.io/cli-runtime v0.37.2 h1:EpE50B2FmXz8SxkYqoS2q0piDk1qe7g9dGZGIW+apws=
k8s.io/cli-runtime v0.37.2/go.mod h1:0IDMrrzVnj1cqBlCll8oGSOb2js6mSy0ALtbh0MsYyc=
k8s.io/client-go v0.37.2 h1:sgFtyRZukGkOrsu+QgS7LYnbFFJ5ut3MchdBNduD//E=
k8s.io/client-go v0.37.2/go.mod h1:bo3LFC8YbCtKFPX21Yj8puMsoJLAv/+SvuOODma0s54=
k8s.io/component-base v0.37.2 h1:Ia9IKTg1yWrUntJU5lVetapkC9pXlLg9L6P3R1IkbcY=
k8s.io/component-base v0.37.2/go.mod h1:qq+ueHZyLfzRJzxyDoyxHWNhF1JPv4zm3hcaddXWDvY=
k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc=
k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0=
k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A=
k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I=
k8s.io/streaming v0.37.1 h1:TpzVfQeFuVndn2g9mFqxy1UcUYPwDzqjUmwR/IzJCWc=
k8s.io/streaming v0.37.1/go.mod h1:APlJR26ZWRcVy5bIEj0QRrKUXROtBHPcxl2NT7EAzPU=
k8s.io/streaming v0.37.2 h1:xmzp9nbqIbjvsRcqrBYa+K5XPQ6Jy/Dm3zZ8mN916AI=
k8s.io/streaming v0.37.2/go.mod h1:APlJR26ZWRcVy5bIEj0QRrKUXROtBHPcxl2NT7EAzPU=
k8s.io/utils v0.0.0-20260626114624-be93311217bd h1:Ea7fgQ5we8Y9T0OX5o0dAHzQOBRI07D/dEYRaB9ZZEs=
k8s.io/utils v0.0.0-20260626114624-be93311217bd/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk=
oras.land/oras-go/v2 v2.7.0 h1:0bXRBBSqYgPSjZRrhJbT71Rb465c+rdlft2xdQPxLtQ=
Expand Down
4 changes: 2 additions & 2 deletions hack/demo/migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Run these scripts from the repository root. They use a dedicated
`library-olm-demo` Kind cluster and only the Kind-generated kubeconfig at
`.kubeconfig/library-olm-demo`; they do not use your current Kubernetes context.
The setup reuses the E2E version pins (Kind v0.33.0, Kubernetes v1.37.0,
OLMv0 v0.46.0, and experimental operator-controller v1.12.0), builds both CLIs,
OLMv0 v0.46.0, and experimental operator-controller pinned in `migration.mk`), builds both CLIs,
and migrates the bootstrap CatalogSource so operator checks can resolve a
serving ClusterCatalog. It is safe to rerun without recreating the cluster.

Prerequisites: Go, Docker, `kubectl`, `curl`, and `sha256sum`; the `make` target
Prerequisites: Go, Docker, Git, `envsubst`, Python 3, `kubectl`, `curl`, and `sha256sum`; the `make` target
installs the pinned Kind binary through Bingo. Release manifests and container
images must be reachable. Allow several minutes for OLM and operator installation.

Expand Down
39 changes: 39 additions & 0 deletions hack/e2e/migration/install-olmv1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail

# Build the pinned controller: released installers use older experimental APIs.
: "${OLM_V1_COMMIT:?OLM_V1_COMMIT is required}"
: "${E2E_KUBECONFIG:?E2E_KUBECONFIG is required}"
: "${E2E_CLUSTER_NAME:?E2E_CLUSTER_NAME is required}"
: "${KIND:?KIND is required}"
[[ "$OLM_V1_COMMIT" =~ ^[0-9a-f]{40}$ ]] || { echo 'OLM_V1_COMMIT must be a full commit hash' >&2; exit 1; }

source_dir=$(mktemp -d)
trap 'rm -rf "$source_dir"' EXIT
git -C "$source_dir" init --quiet
git -C "$source_dir" fetch --quiet --depth=1 https://github.com/operator-framework/operator-controller.git "$OLM_V1_COMMIT"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@joelanford walked me through why we're pulling at a specific commit level here, and I'm not a fan, but I understand we want more stable CI in this repo

@tmshort tmshort Nov 12, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The APIs are experimental/TPNU, so, they can change incompatibly at any time.

git -C "$source_dir" checkout --quiet --detach FETCH_HEAD

# Reuse upstream image names, build targets, manifest generation, and installer.
# Loading into the existing cluster avoids upstream's destructive cluster target.
# setup.sh installs the live catalog after controller installation.
export KUBECONFIG
KUBECONFIG=$(realpath "$E2E_KUBECONFIG")
# The generated Helm manifest uses these image names; do not inherit caller
# image overrides (including make command-line variables) into the build.
make -C "$source_dir" -f Makefile -f - migration-install \
IMAGE_REGISTRY=quay.io/operator-framework IMAGE_TAG=devel \
OPCON_IMAGE_REPO=quay.io/operator-framework/operator-controller \
CATD_IMAGE_REPO=quay.io/operator-framework/catalogd \
OBJECT_CONTROLLER_IMAGE_REPO=quay.io/operator-framework/object-controller \
OPCON_IMG=quay.io/operator-framework/operator-controller:devel \
CATD_IMG=quay.io/operator-framework/catalogd:devel \
OBJECT_CONTROLLER_IMG=quay.io/operator-framework/object-controller:devel \
KIND="$KIND" MIGRATION_CLUSTER="$E2E_CLUSTER_NAME" <<'MAKE'
Comment thread
joelanford marked this conversation as resolved.
Resolved
SHELL := /bin/bash
.SHELLFLAGS := -eu -o pipefail -c
.PHONY: migration-install
migration-install: docker-build manifests
$(KIND) load docker-image $(OPCON_IMG) $(CATD_IMG) $(OBJECT_CONTROLLER_IMG) --name $(MIGRATION_CLUSTER)
MANIFEST=$(EXPERIMENTAL_MANIFEST) DEFAULT_CATALOG=$(CATALOGS_MANIFEST) INSTALL_DEFAULT_CATALOGS=false envsubst '$$DEFAULT_CATALOG,$$CERT_MGR_VERSION,$$INSTALL_DEFAULT_CATALOGS,$$MANIFEST' < scripts/install.tpl.sh | bash
MAKE
43 changes: 26 additions & 17 deletions hack/e2e/migration/setup.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail

# Creates a disposable cluster for the migration E2E suites. Manifest locations are
# required inputs: CI supplies immutable, mirrored copies when it cannot access
# the public release URLs.
# Creates a disposable cluster for the migration E2E suites using pinned OLMv0
# manifests and the current experimental operator-controller source.
: "${E2E_KUBECONFIG:?E2E_KUBECONFIG is required}"
: "${OLM_V0_CRDS:?OLM_V0_CRDS is required}"
: "${OLM_V0_MANIFEST:?OLM_V0_MANIFEST is required}"
: "${OLM_V1_INSTALL:?OLM_V1_INSTALL is required}"
: "${OLM_V1_INSTALL_SHA256:?OLM_V1_INSTALL_SHA256 is required}"
: "${OLM_V1_COMMIT:?OLM_V1_COMMIT is required}"
: "${KIND:?KIND is required}"

root_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)
Expand All @@ -26,6 +24,20 @@ else
fi
kubectl --kubeconfig "$E2E_KUBECONFIG" wait --for=condition=Ready nodes --all --timeout=3m

# Setup is for a fresh installation, not upgrades or repair. Refuse existing
# OLM namespaces or APIs so partial installations also require explicit teardown.
existing=$(kubectl --kubeconfig "$E2E_KUBECONFIG" get \
namespace/olm namespace/olmv1-system \
crd/clusterserviceversions.operators.coreos.com \
crd/clusterextensions.olm.operatorframework.io \
crd/clusterobjectsets.olm.operatorframework.io \
crd/clusterobjectdeployments.olm.operatorframework.io \
--ignore-not-found -o name)
if [[ -n "$existing" ]]; then
printf 'OLM resources already exist in kind cluster %s. Run E2E_CLUSTER_NAME=%s make migration/e2e-teardown, then rerun setup.\n' "$cluster_name" "$cluster_name" >&2
exit 1
fi

# The v0.46 CRD bundle exceeds Kubernetes' client-side last-applied annotation
# limit for the CSV CRD. Server-side apply stores managed fields instead.
kubectl --kubeconfig "$E2E_KUBECONFIG" apply --server-side -f "$OLM_V0_CRDS"
Expand All @@ -35,16 +47,13 @@ if [[ ${E2E_INSTALL_OLMV0:-true} == true ]]; then
kubectl --kubeconfig "$E2E_KUBECONFIG" -n olm wait --for=condition=Available deployment/catalog-operator --timeout=5m
fi

# ClusterObjectSet is an experimental OLMv1 API and is required by the migration
# code, so use operator-controller's experimental installer rather than standard.
# Download a pinned release installer before executing it, restricting redirects
# to HTTPS and verifying its recorded SHA-256.
if ! kubectl --kubeconfig "$E2E_KUBECONFIG" get crd/clusterextensions.olm.operatorframework.io >/dev/null 2>&1; then
installer=$(mktemp)
trap 'rm -f "$installer"' EXIT
curl --fail --location --proto '=https' --proto-redir '=https' --silent --show-error "$OLM_V1_INSTALL" --output "$installer"
printf '%s %s\n' "$OLM_V1_INSTALL_SHA256" "$installer" | sha256sum --check --status
KUBECONFIG="$E2E_KUBECONFIG" bash "$installer"
# Install the controller matching the current experimental COS/COD definitions.
E2E_CLUSTER_NAME="$cluster_name" "$root_dir/hack/e2e/migration/install-olmv1.sh"
kubectl --kubeconfig "$E2E_KUBECONFIG" wait --for=condition=Established crd/clusterextensions.olm.operatorframework.io crd/clustercatalogs.olm.operatorframework.io crd/clusterobjectsets.olm.operatorframework.io crd/clusterobjectdeployments.olm.operatorframework.io --timeout=5m
kubectl --kubeconfig "$E2E_KUBECONFIG" -n olmv1-system wait --for=condition=Available deployment/operator-controller-controller-manager deployment/catalogd-controller-manager deployment/object-controller-controller-manager --timeout=5m

# Fixture clusters intentionally use only their committed catalog.
if [[ ${E2E_INSTALL_OLMV0:-true} == true ]]; then
kubectl --kubeconfig "$E2E_KUBECONFIG" apply -f "https://raw.githubusercontent.com/operator-framework/operator-controller/$OLM_V1_COMMIT/manifests/default-catalogs.yaml"
kubectl --kubeconfig "$E2E_KUBECONFIG" wait --for=condition=Serving clustercatalog/operatorhubio --timeout=5m
fi
kubectl --kubeconfig "$E2E_KUBECONFIG" wait --for=condition=Established crd/clusterextensions.olm.operatorframework.io crd/clustercatalogs.olm.operatorframework.io --timeout=5m
kubectl --kubeconfig "$E2E_KUBECONFIG" -n olmv1-system wait --for=condition=Available deployment/operator-controller-controller-manager deployment/catalogd-controller-manager --timeout=5m
Loading
Loading