diff --git a/.github/actions/test-charts/action.yml b/.github/actions/test-charts/action.yml index 2c3bb37c..f4951c15 100644 --- a/.github/actions/test-charts/action.yml +++ b/.github/actions/test-charts/action.yml @@ -64,9 +64,14 @@ runs: echo "orchestratorCrdsNeeded=true" >> "$GITHUB_OUTPUT" echo "externalDbNeeded=true" >> "$GITHUB_OUTPUT" fi + if [[ "$INPUT_CHART" == "charts/orchestrator-infra" ]]; then + echo "orchestratorCrdsNeeded=true" >> "$GITHUB_OUTPUT" + echo "orchestratorOlmV1CrdsNeeded=true" >> "$GITHUB_OUTPUT" + fi elif [[ "$INPUT_ALL_CHARTS" == "true" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" echo "orchestratorCrdsNeeded=true" >> "$GITHUB_OUTPUT" + echo "orchestratorOlmV1CrdsNeeded=true" >> "$GITHUB_OUTPUT" echo "externalDbNeeded=true" >> "$GITHUB_OUTPUT" else listChanged=$(ct list-changed --target-branch "$INPUT_TARGET_BRANCH") @@ -76,6 +81,10 @@ runs: echo "orchestratorCrdsNeeded=true" >> "$GITHUB_OUTPUT" echo "externalDbNeeded=true" >> "$GITHUB_OUTPUT" fi + if grep -q 'charts/orchestrator-infra' <<< "$listChanged"; then + echo "orchestratorCrdsNeeded=true" >> "$GITHUB_OUTPUT" + echo "orchestratorOlmV1CrdsNeeded=true" >> "$GITHUB_OUTPUT" + fi fi fi @@ -194,6 +203,16 @@ runs: kubectl create -f charts/orchestrator-infra/crds/knative-serving/knative-serving-crd.yaml kubectl create -f "https://github.com/apache/incubator-kie-tools/releases/download/${SONATAFLOW_OPERATOR_VERSION}/apache-kie-${SONATAFLOW_OPERATOR_VERSION}-incubating-sonataflow-operator.yaml" + - name: Install OLM v1 API CRDs (orchestrator-infra chart-testing) + if: steps.list-changed.outputs.orchestratorOlmV1CrdsNeeded == 'true' + shell: bash + env: + OPERATOR_CONTROLLER_VERSION: "v1.11.0" + run: | + url="https://github.com/operator-framework/operator-controller/releases/download/${OPERATOR_CONTROLLER_VERSION}/operator-controller.yaml" + curl -fsSL --proto '=https' "${url}" -o /tmp/operator-controller.yaml + yq ea 'select(.kind == "CustomResourceDefinition")' /tmp/operator-controller.yaml | kubectl create -f - + - name: Set up external services and test resources for rhdh if: steps.list-changed.outputs.externalDbNeeded == 'true' shell: bash diff --git a/charts/orchestrator-infra/Chart.yaml b/charts/orchestrator-infra/Chart.yaml index de9f53b2..522f6961 100644 --- a/charts/orchestrator-infra/Chart.yaml +++ b/charts/orchestrator-infra/Chart.yaml @@ -14,4 +14,4 @@ maintainers: type: application sources: - https://github.com/redhat-developer/rhdh-chart -version: 0.7.0 +version: 0.7.1 diff --git a/charts/orchestrator-infra/README.md b/charts/orchestrator-infra/README.md index f5c824bb..2b7516c2 100644 --- a/charts/orchestrator-infra/README.md +++ b/charts/orchestrator-infra/README.md @@ -1,7 +1,7 @@ # Orchestrator Infra Chart for OpenShift -![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) +![Version: 0.7.1](https://img.shields.io/badge/Version-0.7.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Helm chart to deploy the Orchestrator solution's required infrastructure suite on OpenShift, including OpenShift Serverless Operator and OpenShift Serverless Logic Operator, both required to configure Red Hat Developer Hub to use the Orchestrator. @@ -25,7 +25,7 @@ Kubernetes: `>= 1.25.0-0` ```console helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart -helm install my-orchestrator-infra redhat-developer/redhat-developer-hub-orchestrator-infra --version 0.7.0 +helm install my-orchestrator-infra redhat-developer/redhat-developer-hub-orchestrator-infra --version 0.7.1 ``` > **Tip**: List all releases using `helm list` @@ -119,6 +119,16 @@ helm install my-orchestrator-infra ./charts/orchestrator-infra --set olmVersion= helm install my-orchestrator-infra ./charts/orchestrator-infra --set olmVersion=v1 ``` +### OLM v1 API CRDs (chart-testing only) + +With `olmVersion: v1`, this chart creates `ClusterExtension` resources (see the previous section). Before Kubernetes can accept those objects, the cluster must already expose the OLM v1 API types `ClusterExtension` and `ClusterCatalog`. + +On OpenShift, those APIs usually come from the platform (you do not install them as part of this chart). The `rhdh-operator` plugin-infra flow assumes they are already present when it applies its own `ClusterExtension` manifests. + +Pull request CI tests this chart on a KinD cluster using `ci/upstream-olm-v1-values.yaml`. KinD does not ship OLM v1, so the shared test workflow downloads a pinned [operator-controller](https://github.com/operator-framework/operator-controller) release, applies only the `CustomResourceDefinition` manifests from that bundle, and does **not** install the operator-controller controller. That is enough for `helm template`, `ct install`, and `helm test` to validate the v1 chart output. + +To change which operator-controller release CI uses, update `OPERATOR_CONTROLLER_VERSION` in the `Install OLM v1 API CRDs (orchestrator-infra chart-testing)` step in [`.github/actions/test-charts/action.yml`](../../.github/actions/test-charts/action.yml). + ### Installing Knative Eventing and Knative Serving CRDs The orchestrator-infra chart requires several CRDs for Knative Eventing and Knative Serving. These CRDs will be applied prior to installing the chart, ensuring that Knative CRs can be created as part of the chart's deployment process. This approach eliminates the need to wait for the OpenShift Serverless Operator's subscription to install them beforehand. diff --git a/charts/orchestrator-infra/README.md.gotmpl b/charts/orchestrator-infra/README.md.gotmpl index 17e56993..adc03797 100644 --- a/charts/orchestrator-infra/README.md.gotmpl +++ b/charts/orchestrator-infra/README.md.gotmpl @@ -88,6 +88,16 @@ helm install my-orchestrator-infra ./charts/orchestrator-infra --set olmVersion= helm install my-orchestrator-infra ./charts/orchestrator-infra --set olmVersion=v1 ``` +### OLM v1 API CRDs (chart-testing only) + +With `olmVersion: v1`, this chart creates `ClusterExtension` resources (see the previous section). Before Kubernetes can accept those objects, the cluster must already expose the OLM v1 API types `ClusterExtension` and `ClusterCatalog`. + +On OpenShift, those APIs usually come from the platform (you do not install them as part of this chart). The `rhdh-operator` plugin-infra flow assumes they are already present when it applies its own `ClusterExtension` manifests. + +Pull request CI tests this chart on a KinD cluster using `ci/upstream-olm-v1-values.yaml`. KinD does not ship OLM v1, so the shared test workflow downloads a pinned [operator-controller](https://github.com/operator-framework/operator-controller) release, applies only the `CustomResourceDefinition` manifests from that bundle, and does **not** install the operator-controller controller. That is enough for `helm template`, `ct install`, and `helm test` to validate the v1 chart output. + +To change which operator-controller release CI uses, update `OPERATOR_CONTROLLER_VERSION` in the `Install OLM v1 API CRDs (orchestrator-infra chart-testing)` step in [`.github/actions/test-charts/action.yml`](../../.github/actions/test-charts/action.yml). + ### Installing Knative Eventing and Knative Serving CRDs The orchestrator-infra chart requires several CRDs for Knative Eventing and Knative Serving. These CRDs will be applied prior to installing the chart, ensuring that Knative CRs can be created as part of the chart's deployment process. This approach eliminates the need to wait for the OpenShift Serverless Operator's subscription to install them beforehand. diff --git a/charts/orchestrator-infra/ci/upstream-olm-v1-values.yaml b/charts/orchestrator-infra/ci/upstream-olm-v1-values.yaml new file mode 100644 index 00000000..df021633 --- /dev/null +++ b/charts/orchestrator-infra/ci/upstream-olm-v1-values.yaml @@ -0,0 +1,18 @@ +# Chart-testing values for the OLM v1 install path (ClusterExtension resources). +# Mirrors upstream-olm-values.yaml namespace overrides for KinD + upstream OLM. +olmVersion: v1 + +serverlessLogicOperator: + enabled: true + createNamespace: false + subscription: + namespace: operators + spec: + sourceNamespace: olm + +serverlessOperator: + createNamespace: false + subscription: + namespace: operators + spec: + sourceNamespace: olm