From 9179b05a7fa9ba82a9f3e25c2309d07abe9ac2e4 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Wed, 11 Oct 2023 11:29:12 -0400 Subject: [PATCH 1/3] OCPBUGS-20164: Capability Annotation for Build CRD Add missing `capability.openshift.io/name` annotation to the Build cluster configuration CRD. This will ensure that the config object for the Build sub-system is not created when the Build capability is not enabled. Also annotate the empty-resources Build CRD so that it is linked with the appropriate cluster capability in the payload empty-resources. --- config/v1/0000_10_config-operator_01_build.crd.yaml | 1 + .../empty-resources/0000_05_config-operator_02_build.cr.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/config/v1/0000_10_config-operator_01_build.crd.yaml b/config/v1/0000_10_config-operator_01_build.crd.yaml index 75166deb7c1..9e80775ffef 100644 --- a/config/v1/0000_10_config-operator_01_build.crd.yaml +++ b/config/v1/0000_10_config-operator_01_build.crd.yaml @@ -3,6 +3,7 @@ kind: CustomResourceDefinition metadata: annotations: api-approved.openshift.io: https://github.com/openshift/api/pull/470 + capability.openshift.io/name: Build include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" include.release.openshift.io/single-node-developer: "true" diff --git a/payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml b/payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml index a6dab5dc1f4..c32b468b076 100644 --- a/payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml +++ b/payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml @@ -3,6 +3,7 @@ kind: Build metadata: name: cluster annotations: + capability.openshift.io/name: Build include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" include.release.openshift.io/single-node-developer: "true" From cb13214857769ce870f167cf76f5dae4c419a4ae Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Thu, 12 Oct 2023 09:15:03 -0400 Subject: [PATCH 2/3] Make Build CRD "owned" by ocm-o Marking the Build CRD as "owned" by openshift-controller-manager- operator. This means that its CRD manifest will be included in the ocm-o image, with the right annotations to mark it as part of the "Build" capability. --- ..._10_openshift-controller-manager-operator_01_build.crd.yaml} | 0 config/v1/stable.build.testsuite.yaml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename config/v1/{0000_10_config-operator_01_build.crd.yaml => 0000_10_openshift-controller-manager-operator_01_build.crd.yaml} (100%) diff --git a/config/v1/0000_10_config-operator_01_build.crd.yaml b/config/v1/0000_10_openshift-controller-manager-operator_01_build.crd.yaml similarity index 100% rename from config/v1/0000_10_config-operator_01_build.crd.yaml rename to config/v1/0000_10_openshift-controller-manager-operator_01_build.crd.yaml diff --git a/config/v1/stable.build.testsuite.yaml b/config/v1/stable.build.testsuite.yaml index cdd8a9b7011..b422ebd2065 100644 --- a/config/v1/stable.build.testsuite.yaml +++ b/config/v1/stable.build.testsuite.yaml @@ -1,6 +1,6 @@ apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this name: "[Stable] Build" -crd: 0000_10_config-operator_01_build.crd.yaml +crd: 0000_10_openshift-controller-manager-operator_01_build.crd.yaml tests: onCreate: - name: Should be able to create a minimal Build From 9dd97b96a20e3dc0589e078a30040c12bd33f47d Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Thu, 12 Oct 2023 09:16:14 -0400 Subject: [PATCH 3/3] Remove Build from payload-command Remove the Build CRD from the payload command's empty resources. Rendering of the CRD will be done by ocm-o. --- .../0000_05_config-operator_02_build.cr.yaml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml diff --git a/payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml b/payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml deleted file mode 100644 index c32b468b076..00000000000 --- a/payload-command/empty-resources/0000_05_config-operator_02_build.cr.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: config.openshift.io/v1 -kind: Build -metadata: - name: cluster - annotations: - capability.openshift.io/name: Build - include.release.openshift.io/ibm-cloud-managed: "true" - include.release.openshift.io/self-managed-high-availability: "true" - include.release.openshift.io/single-node-developer: "true" - release.openshift.io/create-only: "true" -spec: {}