File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ that will provision a Google managed SSL certificate.
77We declare some variables defined on the Values. These are reused in `with` and `range` blocks where the scoped variable
88(`.`) is rebound within the block.
99*/ -}}
10- {{- $fullName := include "k8s-service.fullname" . -}}
1110{{- $domainName := .Values.google.managedCertificate.domainName -}}
11+ {{- $certificateName := .Values.google.managedCertificate.name -}}
1212apiVersion : networking.gke.io/v1beta1
1313kind : ManagedCertificate
1414metadata :
15- name : {{ $fullName }}
15+ name : {{ $certificateName }}
1616 labels :
1717 gruntwork.io/app-name : {{ .Values.applicationName }}
1818 # These labels are required by helm. You can read more about required labels in the chart best practices guide:
Original file line number Diff line number Diff line change @@ -355,14 +355,17 @@ google:
355355 # The expected keys are:
356356 # - enabled (bool) (required) : Whether or not the ManagedCertificate resource should be created.
357357 # - domainName (string) : Specifies the domain that the SSL certificate will be created for
358+ # - name (string) : Specifies the name of the SSL certificate that you reference in Ingress with
359+ # networking.gke.io/managed-certificates: name
358360 #
359- # The following example specifies a ManagedCertificate with a domain name 'api.acme.com':
361+ # The following example specifies a ManagedCertificate with a domain name 'api.acme.com' and name 'acme-cert' :
360362 #
361363 # EXAMPLE:
362364 #
363365 # google:
364366 # managedCertificate:
365367 # enabled: true
368+ # name: acme-cert
366369 # domainName: api.acme.com
367370 #
368371 # NOTE: if you enable managedCertificate, then Ingress must also be enabled.
Original file line number Diff line number Diff line change @@ -438,20 +438,23 @@ func TestK8SServiceIngressAdditionalPathsHigherPriorityNoServiceName(t *testing.
438438}
439439
440440// Test rendering Managed Certificate
441- func TestK8SServiceManagedCertDomainName (t * testing.T ) {
441+ func TestK8SServiceManagedCertDomainNameAndName (t * testing.T ) {
442442 t .Parallel ()
443443
444444 cert := renderK8SServiceManagedCertificateWithSetValues (
445445 t ,
446446 map [string ]string {
447447 "google.managedCertificate.enabled" : "true" ,
448448 "google.managedCertificate.domainName" : "api.acme.io" ,
449+ "google.managedCertificate.name" : "acme-cert" ,
449450 },
450451 )
451452
452453 domains := cert .Spec .Domains
454+ certName := cert .ObjectMeta .Name
453455 assert .Equal (t , len (domains ), 1 )
454456 assert .Equal (t , domains [0 ], "api.acme.io" )
457+ assert .Equal (t , certName , "acme-cert" )
455458}
456459
457460// Test that setting ingress.enabled = false will cause the helm template to not render the ManagedCertificate resource
You can’t perform that action at this time.
0 commit comments