{{- if and (not .Values.rails.existingSecret) .Values.rails.secret.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "sure.fullname" . }}-app
  labels:
    {{- include "sure.labels" . | nindent 4 }}
type: Opaque
data:
  {{- range $k, $v := .Values.rails.secret.values }}
  {{- if $v }}
  {{ $k }}: {{ $v | toString | b64enc }}
  {{- end }}
  {{- end }}
{{- end }}
