From 297f36920a4d5087acae1664a065a52066cd8181 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Tue, 14 Oct 2025 23:26:09 +0200 Subject: [PATCH] fix(certificate): subject in body must be of type object --- templates/certificate.yaml | 10 ++++++++++ unittests/certificates/certificate.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/certificate.yaml b/templates/certificate.yaml index 382cf1d..5f657b8 100644 --- a/templates/certificate.yaml +++ b/templates/certificate.yaml @@ -48,6 +48,15 @@ spec: secretTemplate: {{- toYaml . | nindent 4 }} {{- end }} + {{- if or .Values.certificate.new.subject.countries + .Values.certificate.new.subject.localities + .Values.certificate.new.subject.organizationalUnits + .Values.certificate.new.subject.organizations + .Values.certificate.new.subject.postalCodes + .Values.certificate.new.subject.provinces + .Values.certificate.new.subject.serialNumber + .Values.certificate.new.subject.streetAddresses + }} subject: {{- with .Values.certificate.new.subject.countries }} countries: @@ -80,6 +89,7 @@ spec: streetAddresses: {{- toYaml . | nindent 4 }} {{- end }} + {{- end }} usages: {{- range .Values.certificate.new.usages }} - {{ . }} diff --git a/unittests/certificates/certificate.yaml b/unittests/certificates/certificate.yaml index c036cce..1117e15 100644 --- a/unittests/certificates/certificate.yaml +++ b/unittests/certificates/certificate.yaml @@ -99,7 +99,7 @@ tests: path: spec.secretTemplate.annotations - exists: path: spec.secretTemplate.labels - - exists: + - notExists: path: spec.subject - notExists: path: spec.subject.countries