From 67e1cc865b01b0f74d1781fae2f2aa7afae3c5dd Mon Sep 17 00:00:00 2001 From: Todd Short Date: Fri, 27 Jun 2025 08:55:03 -0400 Subject: [PATCH] Add kustomization files for each CRD At the root of each CRD directory, there is a kustomization file. Replicate this into the individual directories, so that they can be referenced directly by overlays. This keeps the "default" reference of `config/base/.../crd` to be the standard CRD for compatibility with existing overlays. The kustomizeconfig.yaml file is not used, and is deleted. This is part of the feature-gated API functionality. Signed-off-by: Todd Short --- .../crd/experimental/kustomization.yaml | 2 ++ config/base/catalogd/crd/kustomization.yaml | 8 +++----- .../catalogd/crd/standard/kustomization.yaml | 2 ++ .../crd/experimental/kustomization.yaml | 2 ++ .../crd/kustomization.yaml | 11 +++-------- .../crd/kustomizeconfig.yaml | 19 ------------------- .../crd/standard/kustomization.yaml | 2 ++ 7 files changed, 14 insertions(+), 32 deletions(-) create mode 100644 config/base/catalogd/crd/experimental/kustomization.yaml create mode 100644 config/base/catalogd/crd/standard/kustomization.yaml create mode 100644 config/base/operator-controller/crd/experimental/kustomization.yaml delete mode 100644 config/base/operator-controller/crd/kustomizeconfig.yaml create mode 100644 config/base/operator-controller/crd/standard/kustomization.yaml diff --git a/config/base/catalogd/crd/experimental/kustomization.yaml b/config/base/catalogd/crd/experimental/kustomization.yaml new file mode 100644 index 000000000..2069f1c13 --- /dev/null +++ b/config/base/catalogd/crd/experimental/kustomization.yaml @@ -0,0 +1,2 @@ +resources: +- olm.operatorframework.io_clustercatalogs.yaml diff --git a/config/base/catalogd/crd/kustomization.yaml b/config/base/catalogd/crd/kustomization.yaml index ff2cde82c..5d7501c33 100644 --- a/config/base/catalogd/crd/kustomization.yaml +++ b/config/base/catalogd/crd/kustomization.yaml @@ -1,6 +1,4 @@ -# This kustomization.yaml is not intended to be run by itself, -# since it depends on service name and namespace that are out of this kustomize package. -# It should be run by config/default +# This kustomization picks the standard CRD by default +# If the experimental CRD is desired, select that directory explicitly resources: -- standard/olm.operatorframework.io_clustercatalogs.yaml -#+kubebuilder:scaffold:crdkustomizeresource +- standard diff --git a/config/base/catalogd/crd/standard/kustomization.yaml b/config/base/catalogd/crd/standard/kustomization.yaml new file mode 100644 index 000000000..2069f1c13 --- /dev/null +++ b/config/base/catalogd/crd/standard/kustomization.yaml @@ -0,0 +1,2 @@ +resources: +- olm.operatorframework.io_clustercatalogs.yaml diff --git a/config/base/operator-controller/crd/experimental/kustomization.yaml b/config/base/operator-controller/crd/experimental/kustomization.yaml new file mode 100644 index 000000000..1c4db41af --- /dev/null +++ b/config/base/operator-controller/crd/experimental/kustomization.yaml @@ -0,0 +1,2 @@ +resources: +- olm.operatorframework.io_clusterextensions.yaml diff --git a/config/base/operator-controller/crd/kustomization.yaml b/config/base/operator-controller/crd/kustomization.yaml index be905c9f0..5d7501c33 100644 --- a/config/base/operator-controller/crd/kustomization.yaml +++ b/config/base/operator-controller/crd/kustomization.yaml @@ -1,9 +1,4 @@ -# This kustomization.yaml is not intended to be run by itself, -# since it depends on service name and namespace that are out of this kustomize package. -# It should be run by config/default +# This kustomization picks the standard CRD by default +# If the experimental CRD is desired, select that directory explicitly resources: -- standard/olm.operatorframework.io_clusterextensions.yaml - -# the following config is for teaching kustomize how to do kustomization for CRDs. -configurations: -- kustomizeconfig.yaml +- standard diff --git a/config/base/operator-controller/crd/kustomizeconfig.yaml b/config/base/operator-controller/crd/kustomizeconfig.yaml deleted file mode 100644 index ec5c150a9..000000000 --- a/config/base/operator-controller/crd/kustomizeconfig.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# This file is for teaching kustomize how to substitute name and namespace reference in CRD -nameReference: -- kind: Service - version: v1 - fieldSpecs: - - kind: CustomResourceDefinition - version: v1 - group: apiextensions.k8s.io - path: spec/conversion/webhook/clientConfig/service/name - -namespace: -- kind: CustomResourceDefinition - version: v1 - group: apiextensions.k8s.io - path: spec/conversion/webhook/clientConfig/service/namespace - create: false - -varReference: -- path: metadata/annotations diff --git a/config/base/operator-controller/crd/standard/kustomization.yaml b/config/base/operator-controller/crd/standard/kustomization.yaml new file mode 100644 index 000000000..1c4db41af --- /dev/null +++ b/config/base/operator-controller/crd/standard/kustomization.yaml @@ -0,0 +1,2 @@ +resources: +- olm.operatorframework.io_clusterextensions.yaml