diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2021-01-13 14:07:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-01-13 14:07:25 +0000 |
commit | 79ee5c9e6efe565e4dd55feddaa70ccf52b52aa1 (patch) | |
tree | 22b137e58d04e13597528f25435359930bf643c9 | |
parent | f26d9eff22180b8232f2965d347226e2a4999cd3 (diff) | |
parent | 7a0f2eb4b0700b89207a7d439a08a7918f3b399a (diff) |
Merge "[CMPV2] Generate certificate name"
-rw-r--r-- | kubernetes/common/common/templates/_certificate.tpl | 18 | ||||
-rw-r--r-- | kubernetes/sdnc/values.yaml | 4 |
2 files changed, 10 insertions, 12 deletions
diff --git a/kubernetes/common/common/templates/_certificate.tpl b/kubernetes/common/common/templates/_certificate.tpl index 74f81af901..d3313b2bc1 100644 --- a/kubernetes/common/common/templates/_certificate.tpl +++ b/kubernetes/common/common/templates/_certificate.tpl @@ -33,11 +33,10 @@ # To be added in the file values.yaml # 1. Minimal version (certificates only in PEM format) # certificates: -# - name: onap-component-certificate -# secretName: onap-component-certificate -# commonName: component.onap.org -# 2. Extended version (with defined own issuer and additional certificate format): -# certificates: +# - commonName: component.onap.org +# +# 2. Extended version (with defined own issuer and additional certificate format): +# certificates: # - name: onap-component-certificate # secretName: onap-component-certificate # commonName: component.onap.org @@ -71,10 +70,11 @@ {{- $dot := default . .dot -}} {{- $certificates := $dot.Values.certificates -}} -{{ range $certificate := $certificates }} +{{ range $i, $certificate := $certificates }} {{/*# General certifiacate attributes #*/}} -{{- $name := $certificate.name -}} -{{- $secretName := $certificate.secretName -}} +{{- $name := include "common.fullname" $dot -}} +{{- $certName := default (printf "%s-cert-%d" $name $i) $certificate.name -}} +{{- $secretName := default (printf "%s-secret-%d" $name $i) $certificate.secretName -}} {{- $commonName := default $dot.Values.global.certificate.default.commonName $certificate.commonName -}} {{- $renewBefore := default $dot.Values.global.certificate.default.renewBefore $certificate.renewBefore -}} {{- $duration := $certificate.duration -}} @@ -122,7 +122,7 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: - name: {{ $name }} + name: {{ $certName }} namespace: {{ $namespace }} spec: secretName: {{ $secretName }} diff --git a/kubernetes/sdnc/values.yaml b/kubernetes/sdnc/values.yaml index 1d2fa266ea..0263dfddc1 100644 --- a/kubernetes/sdnc/values.yaml +++ b/kubernetes/sdnc/values.yaml @@ -141,9 +141,7 @@ secrets: # Certificates ################################################################# certificates: - - name: onap-sdnc-certificate - secretName: onap-sdnc-certificate - commonName: sdnc.simpledemo.onap.org + - commonName: sdnc.simpledemo.onap.org dnsNames: - sdnc.simpledemo.onap.org p12Keystore: |