Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/helm_lib/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
type: library
name: deckhouse_lib_helm
version: 1.72.9
version: 1.72.10
description: "Helm utils template definitions for Deckhouse modules."
14 changes: 14 additions & 0 deletions charts/helm_lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
| [helm_lib_module_uri_scheme](#helm_lib_module_uri_scheme) |
| [helm_lib_module_https_mode](#helm_lib_module_https_mode) |
| [helm_lib_module_https_cert_manager_cluster_issuer_name](#helm_lib_module_https_cert_manager_cluster_issuer_name) |
| [helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api](#helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api) |
| [helm_lib_module_https_ingress_tls_enabled](#helm_lib_module_https_ingress_tls_enabled) |
| [helm_lib_module_https_route_tls_enabled](#helm_lib_module_https_route_tls_enabled) |
| [helm_lib_module_https_copy_custom_certificate](#helm_lib_module_https_copy_custom_certificate) |
Expand Down Expand Up @@ -899,6 +900,19 @@ list:
- Template context with .Values, .Chart, etc


### helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api

returns cluster issuer name compatible with gateway api scheme

#### Usage

`{{ include "helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api" . }} `

#### Arguments

- Template context with .Values, .Chart, etc


### helm_lib_module_https_ingress_tls_enabled

returns not empty string if tls should be enabled for the ingress
Expand Down
15 changes: 15 additions & 0 deletions charts/helm_lib/templates/_module_https.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ certManager:
{{- $https_values.certManager.clusterIssuerName -}}
{{- end -}}

{{- /* Usage: {{ include "helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api" . }} */ -}}
{{- /* returns cluster issuer name compatible with gateway api scheme */ -}}
{{- define "helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api" -}}
{{- $context := . -}} {{- /* Template context with .Values, .Chart, etc */ -}}
{{- $issuerName := include "helm_lib_module_https_cert_manager_cluster_issuer_name" $context -}}
{{- $moduleGateway := dict -}}
{{- include "helm_lib_module_gateway" (list . $moduleGateway) -}}
{{- if $moduleGateway -}}
{{- if or (eq $issuerName "letsencrypt") (eq $issuerName "letsencrypt-staging") }}
{{- $issuerName = printf "%s-gateway-%s" $issuerName $moduleGateway.name }}
{{- end }}
{{- end -}}
{{- $issuerName -}}
{{- end -}}

{{- /* Usage: {{ if (include "helm_lib_module_https_cert_manager_cluster_issuer_is_dns01_challenge_solver" .) }} */ -}}
{{- define "helm_lib_module_https_cert_manager_cluster_issuer_is_dns01_challenge_solver" -}}
{{- $context := . -}} {{- /* Template context with .Values, .Chart, etc */ -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
issuer_name: {{ include "helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api" . }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
suite: helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api definition
templates:
- helm_lib_module_https_cert_manager_cluster_issuer_name_for_gateway_api.yaml
set:
global:
modules:
gatewayAPIGateway:
name: global
namespace: d8-alb
https:
mode: "CertManager"
certManager:
clusterIssuerName: "global-issuer"
enabledModules: ["cert-manager"]
tests:
- it: should return global cert manager cluster issuer name
asserts:
- equal:
path: "issuer_name"
value: "global-issuer"

- it: should return module cert manager cluster issuer name
set:
testModule:
https:
mode: "CertManager"
certManager:
clusterIssuerName: "module-issuer"
asserts:
- equal:
path: "issuer_name"
value: "module-issuer"

- it: should return gateway-related cert manager cluster issuer name
set:
testModule:
https:
mode: "CertManager"
certManager:
clusterIssuerName: "letsencrypt"
asserts:
- equal:
path: "issuer_name"
value: "letsencrypt-gateway-global"

- it: should return gateway-related cert manager cluster issuer name #2
set:
testModule:
https:
mode: "CertManager"
certManager:
clusterIssuerName: "letsencrypt-staging"
asserts:
- equal:
path: "issuer_name"
value: "letsencrypt-staging-gateway-global"
Loading