From c9229ce8d30d4c1ada82caa090fbe520a7c6f054 Mon Sep 17 00:00:00 2001 From: Adrian Ludwin Date: Wed, 30 Mar 2022 18:50:51 -0400 Subject: [PATCH] Fix cert-manager build error (cherry-pick) Tested: erikgb reports that this works --- config/certmanager/certificate.yaml | 4 ++-- config/crd/patches/cainjection_in_hierarchies.yaml | 8 -------- config/variants/default-cm/README | 12 ++++++++++++ 3 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 config/crd/patches/cainjection_in_hierarchies.yaml diff --git a/config/certmanager/certificate.yaml b/config/certmanager/certificate.yaml index bcfcc533c..b28ee1044 100644 --- a/config/certmanager/certificate.yaml +++ b/config/certmanager/certificate.yaml @@ -1,6 +1,6 @@ # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io -apiVersion: cert-manager.io/v1alpha2 +apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: selfsigned-issuer @@ -8,7 +8,7 @@ metadata: spec: selfSigned: {} --- -apiVersion: cert-manager.io/v1alpha2 +apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml diff --git a/config/crd/patches/cainjection_in_hierarchies.yaml b/config/crd/patches/cainjection_in_hierarchies.yaml deleted file mode 100644 index 1d9900e3c..000000000 --- a/config/crd/patches/cainjection_in_hierarchies.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -# CRD conversion requires k8s 1.13 or later. -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: hierarchies.hnc.x-k8s.io diff --git a/config/variants/default-cm/README b/config/variants/default-cm/README index dabe07c0e..efd0b3250 100644 --- a/config/variants/default-cm/README +++ b/config/variants/default-cm/README @@ -5,3 +5,15 @@ building the manifests ("made manifests" in the root directory). As of March 2022, I (aludwin@google.com) have not actually tested this to see if it works. + +If/when we next need to use CRD conversion webhooks, add the following patches +to this directory: + +# The following patch adds a directive for certmanager to inject CA into the CRD +# CRD conversion requires k8s 1.13 or later. +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: hierarchies.hnc.x-k8s.io