Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
issuer naming should respect issuer_name override (#378)
Browse files Browse the repository at this point in the history
align the spire-server configmap and issuer CR naming

---------

Signed-off-by: Drew Wells <dwells@infoblox.com>
Signed-off-by: Faisal Memon <fymemon@yahoo.com>
Co-authored-by: Faisal Memon <fymemon@yahoo.com>
  • Loading branch information
drewwells and faisal-memon committed Aug 2, 2023
1 parent a2e5c36 commit d2e1606
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/spire/charts/spire-server/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ plugins:
UpstreamAuthority:
- cert-manager:
plugin_data:
issuer_name: {{ default (include "spire-server.fullname" $root) .issuer_name }}
issuer_name: {{ default (include "spire-server.fullname" $root) .issuer_name }}-ca
issuer_kind: {{ .issuer_kind | quote }}
issuer_group: {{ .issuer_group | quote }}
namespace: {{ default $root.Release.Namespace .namespace | quote }}
Expand Down
7 changes: 4 additions & 3 deletions charts/spire/charts/spire-server/templates/issuer.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{{- with .Values.upstreamAuthority.certManager }}
{{ if and .enabled .ca.create }}
{{ $issuerName := printf "%s-selfsigned" (default (include "spire-server.fullname" $) .issuer_name) }}
{{/*
Configuring CA Issuer: https://cert-manager.io/docs/configuration/ca/
*/}}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ include "spire-server.fullname" $ }}-selfsigned
name: {{ $issuerName }}
namespace: {{ include "spire-server.namespace" $ }}
labels:
{{- include "spire-server.labels" $ | nindent 4}}
Expand Down Expand Up @@ -38,14 +39,14 @@ spec:
renewBefore: {{ . }}
{{- end }}
issuerRef:
name: {{ include "spire-server.fullname" $ }}-selfsigned
name: {{ $issuerName }}
kind: Issuer
group: cert-manager.io
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ include "spire-server.fullname" $ }}
name: {{ include "spire-server.fullname" $ }}-ca
namespace: {{ include "spire-server.namespace" $ }}
spec:
ca:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
- --timeout=3m
- --for=condition=ready
- issuer
- {{ include "spire-server.fullname" $ }}
- {{ include "spire-server.fullname" $ }}-ca
imagePullPolicy: {{ .Values.tools.kubectl.image.pullPolicy }}
{{- end }}
{{- if gt (len .Values.initContainers) 0 }}
Expand Down

0 comments on commit d2e1606

Please sign in to comment.