spiffe / helm-charts-hardened

Apache License 2.0
12 stars 26 forks source link

trust-domain added to a fqdn in ingress #312

Closed hhopen closed 2 months ago

hhopen commented 3 months ago

Hi,

Looks like the order of arguments is wrong for the string comparison in template function spire-lib.ingress-calculated-name. The test fails to find a '.' in the hostname and trust-domain is added to a fqdn.

diff --git a/charts/spire/templates/_spire-lib.tpl b/charts/spire/templates/_spire-lib.tpl
index 239efc1..db33cee 100644
--- a/charts/spire/templates/_spire-lib.tpl
+++ b/charts/spire/templates/_spire-lib.tpl
@@ -94,7 +94,7 @@
 */}}
 {{ define "spire-lib.ingress-calculated-name" }}
 {{- $host := .ingress.host }}
-{{- if not (contains $host ".") }}
+{{- if not (contains "." $host) }}
 {{-   $host = printf "%s.%s" $host (include "spire-lib.trust-domain" .) }}
 {{- end }}
 {{- $host }}
kfox1111 commented 2 months ago

Sorry about the delay. Was out on vacation. Thanks for reporting this issue. Fix incoming.