{{ if and .Values.gcs.enabled .Values.gcs.jsonKey }}
apiVersion: v1
kind: Secret
metadata:
{{- if .Values.gcs.secret }}
  name: {{ .Values.gcs.secret }}
{{- else }}
  name: {{ template "spinnaker.fullname" . }}-gcs
{{- end }}
  labels:
{{ include "spinnaker.standard-labels" . | indent 4 }}
    component: halyard
type: Opaque
data:
  key.json: {{ .Values.gcs.jsonKey | b64enc }}
{{ end }}
