Skip to content

Chart: Improve git-sync support #15786

@kaxil

Description

@kaxil

Following things needs to be improved in the Helm Chart before we can release it to better support git-sync:

  • There should be a way to pass additional environment variables (listed here) to git-sync containers instead of hard-coded list at
    {{/* Git sync container */}}
    {{- define "git_sync_container"}}
    - name: {{ .Values.dags.gitSync.containerName }}
    image: {{ template "git_sync_image" . }}
    imagePullPolicy: {{ .Values.images.gitSync.pullPolicy }}
    securityContext:
    runAsUser: {{ .Values.dags.gitSync.uid }}
    env:
    {{- if .Values.dags.gitSync.sshKeySecret }}
    - name: GIT_SSH_KEY_FILE
    value: "/etc/git-secret/ssh"
    - name: GIT_SYNC_SSH
    value: "true"
    {{- if .Values.dags.gitSync.knownHosts }}
    - name: GIT_KNOWN_HOSTS
    value: "true"
    - name: GIT_SSH_KNOWN_HOSTS_FILE
    value: "/etc/git-secret/known_hosts"
    {{- else }}
    - name: GIT_KNOWN_HOSTS
    value: "false"
    {{- end }}
    {{ else if .Values.dags.gitSync.credentialsSecret }}
    - name: GIT_SYNC_USERNAME
    valueFrom:
    secretKeyRef:
    name: {{ .Values.dags.gitSync.credentialsSecret | quote }}
    key: GIT_SYNC_USERNAME
    - name: GIT_SYNC_PASSWORD
    valueFrom:
    secretKeyRef:
    name: {{ .Values.dags.gitSync.credentialsSecret | quote }}
    key: GIT_SYNC_PASSWORD
    {{- end }}
    - name: GIT_SYNC_REV
    value: {{ .Values.dags.gitSync.rev | quote }}
    - name: GIT_SYNC_BRANCH
    value: {{ .Values.dags.gitSync.branch | quote }}
    - name: GIT_SYNC_REPO
    value: {{ .Values.dags.gitSync.repo | quote }}
    - name: GIT_SYNC_DEPTH
    value: {{ .Values.dags.gitSync.depth | quote }}
    - name: GIT_SYNC_ROOT
    value: {{ .Values.dags.gitSync.root | quote }}
    - name: GIT_SYNC_DEST
    value: {{ .Values.dags.gitSync.dest | quote }}
    - name: GIT_SYNC_ADD_USER
    value: "true"
    - name: GIT_SYNC_WAIT
    value: {{ .Values.dags.gitSync.wait | quote }}
    - name: GIT_SYNC_MAX_SYNC_FAILURES
    value: {{ .Values.dags.gitSync.maxFailures | quote }}
    {{- if .is_init }}
    - name: GIT_SYNC_ONE_TIME
    value: "true"
    {{- end }}
    volumeMounts:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions