{{- if and .Values.concourse.web.kubernetes.enabled .Values.concourse.web.kubernetes.createTeamNamespaces -}}
{{- range .Values.concourse.web.kubernetes.teams }}
---
apiVersion: v1
kind: Namespace
metadata:
{{- if $.Values.concourse.web.kubernetes.keepNamespaces }}
  annotations:
    "helm.sh/resource-policy": keep
{{- end }}
  name: {{ template "concourse.namespacePrefix" $ }}{{ . }}
  labels:
    app: {{ template "concourse.concourse.fullname" $ }}
    chart: "{{ $.Chart.Name }}-{{ $.Chart.Version }}"
    release: "{{ $.Release.Name }}"
    heritage: "{{ $.Release.Service }}"
{{- end }}
{{- end -}}
