ingress-nginx production tests and spiffe-oidc-discovery-provider example (#136)
Co-authored-by: Marco Franssen <[email protected]>
This commit is contained in:
co-authored by
Marco Franssen
parent
b05175e2b6
commit
e81a59a7e5
@@ -203,6 +203,21 @@ The code below determines what connection type should be used.
|
||||
{{- include "spire-tornjak.backend" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "spire-server.test.federation-ingress-args" }}
|
||||
{{- $args := list }}
|
||||
{{- $host := index (index (index .Values.federation.ingress.tls 0) "hosts") 0 }}
|
||||
{{- if dig "tests" "tls" "enabled" false .Values }}
|
||||
{{- if ne (len (dig "tests" "tls" "customCA" "" .Values)) 0 }}
|
||||
{{- $args = append $args "--cacert" }}
|
||||
{{- $args = append $args "/ca/ca.crt" }}
|
||||
{{- end }}
|
||||
{{- $args = append $args (printf "https://%s/" $host) }}
|
||||
{{- else }}
|
||||
{{- $args = append $args (printf "http://%s/" $host) }}
|
||||
{{- end }}
|
||||
{{ $args | toYaml }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Take a copy of the config and merge in .Values.customPlugins and .Values.unsupportedBuiltInPlugins passed through as root.
|
||||
*/}}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{ $values := merge .Values }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
@@ -38,4 +39,28 @@ spec:
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.federation.ingress.enabled }}
|
||||
- name: federation-ingress
|
||||
image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
|
||||
command: ['curl']
|
||||
args:
|
||||
{{ include "spire-server.test.federation-ingress-args" (dict "Values" $values) | nindent 8 }}
|
||||
{{- if ne (len (dig "tests" "tls" "customCA" "" $values)) 0 }}
|
||||
volumeMounts:
|
||||
- name: custom-ca
|
||||
mountPath: /ca
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if ne (len (dig "tests" "hostAliases" "" $values)) 0 }}
|
||||
hostAliases:
|
||||
{{- toYaml .Values.tests.hostAliases | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if ne (len (dig "tests" "tls" "customCA" "" $values)) 0 }}
|
||||
volumes:
|
||||
- name: custom-ca
|
||||
secret:
|
||||
secretName: {{ .Values.tests.tls.customCA }}
|
||||
{{- end }}
|
||||
restartPolicy: Never
|
||||
|
||||
Reference in New Issue
Block a user