From d8844041594eb3370cee40d41ffc2131cfcceb93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikul=C3=A1=C5=A1=20D=C3=ADt=C4=9B?= Date: Mon, 12 Feb 2018 15:53:17 +0100 Subject: [PATCH] Add default shortNames to certificates CRD Defaults to [cert, certs] and is configurable with `certificateCRDShortNames` parameter. [Closes #311] --- contrib/charts/cert-manager/README.md | 1 + contrib/charts/cert-manager/templates/certificate-crd.yaml | 6 +++++- contrib/charts/cert-manager/values.yaml | 2 ++ docs/deploy/rbac/certificate-crd.yaml | 6 +++++- docs/deploy/without-rbac/certificate-crd.yaml | 6 +++++- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/contrib/charts/cert-manager/README.md b/contrib/charts/cert-manager/README.md index e7a010068..78218ffd1 100644 --- a/contrib/charts/cert-manager/README.md +++ b/contrib/charts/cert-manager/README.md @@ -58,6 +58,7 @@ The following tables lists the configurable parameters of the cert-manager chart | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `replicaCount` | Number of cert-manager replicas | `1` | | `createCustomResource` | Create CRD/TPR with this release | `true` | +| `certificateResourceShortNames` | Custom aliases for Certificate CRD | `["cert", "certs"]` | | `extraArgs` | Optional flags for cert-manager | `[]` | | `rbac.create` | If `true`, create and use RBAC resources | `true` | `serviceAccount.create` | If `true`, create a new service account | `true` diff --git a/contrib/charts/cert-manager/templates/certificate-crd.yaml b/contrib/charts/cert-manager/templates/certificate-crd.yaml index 8153c81bc..1024900ba 100644 --- a/contrib/charts/cert-manager/templates/certificate-crd.yaml +++ b/contrib/charts/cert-manager/templates/certificate-crd.yaml @@ -11,8 +11,12 @@ metadata: spec: group: certmanager.k8s.io version: v1alpha1 + scope: Namespaced names: kind: Certificate plural: certificates - scope: Namespaced + {{- if .Values.certificateResourceShortNames }} + shortNames: +{{ toYaml .Values.certificateResourceShortNames | indent 6 }} + {{- end -}} {{- end -}} diff --git a/contrib/charts/cert-manager/values.yaml b/contrib/charts/cert-manager/values.yaml index ccd0ad3de..5fe01a48a 100644 --- a/contrib/charts/cert-manager/values.yaml +++ b/contrib/charts/cert-manager/values.yaml @@ -10,6 +10,8 @@ image: createCustomResource: true +certificateResourceShortNames: ["cert", "certs"] + rbac: # Specifies whether RBAC resources should be created create: true diff --git a/docs/deploy/rbac/certificate-crd.yaml b/docs/deploy/rbac/certificate-crd.yaml index ed7580866..b997196da 100644 --- a/docs/deploy/rbac/certificate-crd.yaml +++ b/docs/deploy/rbac/certificate-crd.yaml @@ -12,7 +12,11 @@ metadata: spec: group: certmanager.k8s.io version: v1alpha1 + scope: Namespaced names: kind: Certificate plural: certificates - scope: Namespaced \ No newline at end of file + shortNames: + - cert + - certs + \ No newline at end of file diff --git a/docs/deploy/without-rbac/certificate-crd.yaml b/docs/deploy/without-rbac/certificate-crd.yaml index ed7580866..b997196da 100644 --- a/docs/deploy/without-rbac/certificate-crd.yaml +++ b/docs/deploy/without-rbac/certificate-crd.yaml @@ -12,7 +12,11 @@ metadata: spec: group: certmanager.k8s.io version: v1alpha1 + scope: Namespaced names: kind: Certificate plural: certificates - scope: Namespaced \ No newline at end of file + shortNames: + - cert + - certs + \ No newline at end of file