--- apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: {{- with .Values.base.helm.repo.namespace }} name: "{{ $.Release.Namespace }}-{{ $.Release.Name }}" namespace: {{ . }} {{- else }} name: "{{ $.Release.Name }}" {{- end }} spec: url: {{ .Values.base.helm.repo.url | quote }} ref: {{- toYaml .Values.base.helm.repo.ref | nindent 4 }} {{- with .Values.base.helm.repo.secretRef }} secretRef: {{- toYaml . | nindent 4 }} {{- end }} {{- with .Values.base.helm.repo.verify }} verify: {{- toYaml . | nindent 4 }} {{- end }} interval: {{ .Values.base.helm.repo.interval }} {{/* if branch is set */}} {{- range $componentInstance, $config := .Values.components }} {{- if and $config.enabled $config.branch }} --- apiVersion: source.toolkit.fluxcd.io/v1 kind: GitRepository metadata: {{- with $.Values.base.helm.repo.namespace }} name: "{{ $.Release.Namespace }}-{{ $.Release.Name }}-{{ $componentInstance }}" namespace: {{ . }} {{- else }} name: "{{ $.Release.Name }}-{{ $componentInstance }}" {{- end }} spec: url: {{ $.Values.base.helm.repo.url | quote }} ref: branch: {{ $config.branch | quote }} {{- with $.Values.base.helm.repo.secretRef }} secretRef: {{- toYaml . | nindent 4 }} {{- end }} {{- with $.Values.base.helm.repo.verify }} verify: {{- toYaml . | nindent 4 }} {{- end }} interval: {{ $.Values.base.helm.repo.interval }} {{- end }} {{- end }}