{{- if .Values.worker.enabled  }}
{{- if .Values.secrets.create }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "concourse.worker.fullname" . }}
  labels:
    app: {{ template "concourse.worker.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  host-key-pub: {{ .Values.secrets.hostKeyPub | b64enc | quote }}
  worker-key: {{ .Values.secrets.workerKey | b64enc | quote }}
{{- end }}
{{- end }}
