From 47df03366f58271844f8b496b0fd43d165890902 Mon Sep 17 00:00:00 2001 From: g-soeldner <91083741+g-soeldner@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:01:34 +0000 Subject: [PATCH] feat: add changes --- api/v1beta1/googlecasissuer_types.go | 5 +++++ .../crds/cas-issuer.jetstack.io_googlecasclusterissuers.yaml | 3 +++ .../crds/cas-issuer.jetstack.io_googlecasissuers.yaml | 3 +++ pkg/cas/cas.go | 1 + 4 files changed, 12 insertions(+) diff --git a/api/v1beta1/googlecasissuer_types.go b/api/v1beta1/googlecasissuer_types.go index 9ff8e7d6c..988134d32 100644 --- a/api/v1beta1/googlecasissuer_types.go +++ b/api/v1beta1/googlecasissuer_types.go @@ -47,6 +47,11 @@ type GoogleCASIssuerSpec struct { // Credentials is a reference to a Kubernetes Secret Key that contains Google Service Account Credentials // +optional Credentials cmmetav1.SecretKeySelector `json:"credentials,omitempty"` + + // CertificateTemplate is specific certificate template to + // use. Omit to not specify a template + // +optional + CertificateTemplate string `json:"certificateTemplate,omitempty"` } // GoogleCASIssuerStatus defines the observed state of GoogleCASIssuer diff --git a/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasclusterissuers.yaml b/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasclusterissuers.yaml index 1e13b691c..4ff1a66c3 100644 --- a/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasclusterissuers.yaml +++ b/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasclusterissuers.yaml @@ -48,6 +48,9 @@ spec: certificateAuthorityId: description: CertificateAuthorityId is specific certificate authority to use to sign. Omit in order to load balance across all CAs in the pool type: string + certificateTemplate: + description: CertificateTemplate is specific certificate template to use. Omit to not specify a template + type: string credentials: description: Credentials is a reference to a Kubernetes Secret Key that contains Google Service Account Credentials type: object diff --git a/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasissuers.yaml b/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasissuers.yaml index 4cc0fa404..cc9c34ff1 100644 --- a/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasissuers.yaml +++ b/deploy/charts/google-cas-issuer/templates/crds/cas-issuer.jetstack.io_googlecasissuers.yaml @@ -48,6 +48,9 @@ spec: certificateAuthorityId: description: CertificateAuthorityId is specific certificate authority to use to sign. Omit in order to load balance across all CAs in the pool type: string + certificateTemplate: + description: CertificateTemplate is specific certificate template to use. Omit to not specify a template + type: string credentials: description: Credentials is a reference to a Kubernetes Secret Key that contains Google Service Account Credentials type: object diff --git a/pkg/cas/cas.go b/pkg/cas/cas.go index 1a99e1aba..c430b8c38 100644 --- a/pkg/cas/cas.go +++ b/pkg/cas/cas.go @@ -74,6 +74,7 @@ func (c *casSigner) Sign(csr []byte, expiry time.Duration) (cert []byte, ca []by Seconds: expiry.Milliseconds() / 1000, Nanos: 0, }, + CertificateTemplate: c.spec.CertificateTemplate, }, RequestId: uuid.New().String(), IssuingCertificateAuthorityId: c.spec.CertificateAuthorityId,