From 83b68574ada9b25e5e1fc3eb26afaafba5b77459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 23 Oct 2024 19:05:23 +0200 Subject: [PATCH] Fix host when ingress disabled --- .changeset/curvy-tips-shake.md | 5 +++++ charts/openproject/templates/secret_core.yaml | 2 +- spec/charts/openproject/host_name_spec.rb | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .changeset/curvy-tips-shake.md diff --git a/.changeset/curvy-tips-shake.md b/.changeset/curvy-tips-shake.md new file mode 100644 index 0000000..c5e46a7 --- /dev/null +++ b/.changeset/curvy-tips-shake.md @@ -0,0 +1,5 @@ +--- +"@openproject/helm-charts": patch +--- + +Fix indent when outputting host without ingress diff --git a/charts/openproject/templates/secret_core.yaml b/charts/openproject/templates/secret_core.yaml index 8efedd8..cf1e6bc 100644 --- a/charts/openproject/templates/secret_core.yaml +++ b/charts/openproject/templates/secret_core.yaml @@ -23,7 +23,7 @@ stringData: OPENPROJECT_SEED_LOCALE: {{ .Values.openproject.seed_locale | quote }} {{- if .Values.ingress.enabled }} OPENPROJECT_HOST__NAME: {{ .Values.openproject.host | default .Values.ingress.host | quote }} - {{- else if .Values.openproject.host -}} + {{- else if .Values.openproject.host }} OPENPROJECT_HOST__NAME: {{ .Values.openproject.host | quote }} {{- end }} OPENPROJECT_HSTS: {{ .Values.openproject.hsts | quote }} diff --git a/spec/charts/openproject/host_name_spec.rb b/spec/charts/openproject/host_name_spec.rb index 678bca9..3948e0b 100644 --- a/spec/charts/openproject/host_name_spec.rb +++ b/spec/charts/openproject/host_name_spec.rb @@ -46,4 +46,22 @@ .not_to include("OPENPROJECT_HOST__NAME") end end + + context 'when setting host name and disabling ingress' do + let(:default_values) do + HelmTemplate.with_defaults(<<~YAML + ingress: + enabled: false + openproject: + host: foo.example.com + YAML + ) + end + + it 'the host is not output', :aggregate_failures do + expect(subject) + .to include("OPENPROJECT_HOST__NAME" => "foo.example.com") + + end + end end