{{- if .Values.controller.secretClaims -}}
{{- $r := .Release -}}
{{- $v := .Values -}}
{{- $chart := printf "%s-%s" .Chart.Name .Chart.Version -}}
{{- $namespace := include "jenkins.namespace" . -}}
{{- $serviceName := include "jenkins.fullname" . -}}
{{ range .Values.controller.secretClaims }}
---
kind: SecretClaim
apiVersion: vaultproject.io/v1
metadata:
  name: {{ $serviceName }}-{{ .name | default .path | lower }}
  namespace: {{ $namespace }}
  labels:
    "app.kubernetes.io/name": '{{ $serviceName }}'
    {{- if $v.renderHelmLabels }}
    "helm.sh/chart": "{{ $chart }}"
    {{- end }}
    "app.kubernetes.io/managed-by": "{{ $r.Service }}"
    "app.kubernetes.io/instance": "{{ $r.Name }}"
    "app.kubernetes.io/component": "{{ $v.controller.componentName }}"
spec:
  type: {{ .type | default "Opaque" }}
  path: {{ .path }}
{{- if .renew }}
  renew: {{ .renew }}
{{- end }}
{{- end }}
{{- end }}