{{- $root := . }}
{{- with .Values.configuration }}
{{- with .backupStorageLocation }}
apiVersion: ark.heptio.com/v1
kind: BackupStorageLocation
metadata:
  name: default
  labels:
    chart: {{ template "ark.chart" $root }}
    heritage: {{ $root.Release.Service }}
    release: {{ $root.Release.Name }}
    app: {{ template "ark.name" $root }}
spec:
  provider: {{ .name  }}
  objectStorage:
    bucket: {{ .bucket  }}
    {{- with .prefix }}
    prefix: {{ . }}
    {{- end }}
{{- with .config }}
  config:
  {{- with .region }}
    region: {{ . }}
  {{- end }}
  {{- with .s3ForcePathStyle }}
    s3ForcePathStyle: {{ . | quote }}
  {{- end }}
  {{- with .s3Url }}
    s3Url: {{ . }}
  {{- end }}
  {{- with .kmsKeyId }}
    kmsKeyId: {{ . }}
  {{- end }}
  {{- with .resourceGroup }}
    resourceGroup: {{ . }}
  {{- end }}
  {{- with .storageAccount }}
    storageAccount: {{ . }}
  {{- end }}
  {{- if .publicUrl }}
  {{- with .publicUrl }}
    publicUrl: {{ . }}
  {{- end }}
  {{- end }}
{{- end }}
{{- end }}
{{- end }}
