From befa0747637c880b86a42d4336425c7d004b69bc Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Thu, 11 Jan 2024 02:31:02 -0800 Subject: [PATCH] Fix notes bug (#178) --- charts/spire/templates/NOTES.txt | 10 ++++++---- tests/unit/spire_test.go | 11 +++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/charts/spire/templates/NOTES.txt b/charts/spire/templates/NOTES.txt index 6da2681..0b8a729 100644 --- a/charts/spire/templates/NOTES.txt +++ b/charts/spire/templates/NOTES.txt @@ -21,13 +21,15 @@ Warning: You're using an unsupported plugin. Functionality of this release and f Warning: You're using an experimental config. Functionality of this release and future upgrades aren't guaranteed to work smoothly. {{- end }} -{{- $className := include "spire-server.controller-manager-class-name" (dict "Values" (index .Values "spire-server") "Release" .Release) }} -{{- if (index .Values "spire-server").controllerManager.enabled }} -{{- if (index .Values "spire-server").controllerManager.watchClassless }} +{{- if (index .Values "spire-server").enabled }} +{{- $className := include "spire-server.controller-manager-class-name" (dict "Values" (index .Values "spire-server") "Release" .Release) }} +{{- if (index .Values "spire-server").controllerManager.enabled }} +{{- if (index .Values "spire-server").controllerManager.watchClassless }} Spire CR's will be handled if no className is specified or if className is set to "{{ $className }}" -{{- else }} +{{- else }} Spire CR's will be handled only if className is set to "{{ $className }}" +{{- end }} {{- end }} {{- end }} diff --git a/tests/unit/spire_test.go b/tests/unit/spire_test.go index 891771b..0c849ca 100644 --- a/tests/unit/spire_test.go +++ b/tests/unit/spire_test.go @@ -133,4 +133,15 @@ spire-agent: Expect(notes).Should(ContainSubstring("join_token")) }) }) + Describe("spire-server.disabled", func() { + It("spire server off", func() { + objs, err := ValueStringRender(chart, ` +spire-server: + enabled: false +`) + Expect(err).Should(Succeed()) + notes := objs["spire/templates/NOTES.txt"] + Expect(notes).Should(ContainSubstring("Installed")) + }) + }) })