shohamy7 commented on code in PR #34731:
URL: https://github.com/apache/airflow/pull/34731#discussion_r1426407929


##########
chart/templates/_helpers.yaml:
##########
@@ -202,50 +202,88 @@ If release name contains chart name it will be used as a 
full name.
     {{- if .Values.dags.gitSync.sshKeySecret }}
     - name: GIT_SSH_KEY_FILE
       value: "/etc/git-secret/ssh"
+    - name: GITSYNC_SSH_KEY_FILE
+      value: "/etc/git-secret/ssh"
     - name: GIT_SYNC_SSH
       value: "true"
+    - name: GITSYNC_SSH
+      value: "true"
     {{- if .Values.dags.gitSync.knownHosts }}
     - name: GIT_KNOWN_HOSTS
       value: "true"
+    - name: GITSYNC_SSH_KNOWN_HOSTS
+      value: "true"
     - name: GIT_SSH_KNOWN_HOSTS_FILE
       value: "/etc/git-secret/known_hosts"
+    - name: GITSYNC_SSH_KNOWN_HOSTS_FILE
+      value: "/etc/git-secret/known_hosts"
     {{- else }}
     - name: GIT_KNOWN_HOSTS
       value: "false"
+    - name: GITSYNC_SSH_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: GITSYNC_USERNAME
+      valueFrom:
+        secretKeyRef:
+          name: {{ .Values.dags.gitSync.credentialsSecret | quote }}
+          key: GITSYNC_USERNAME
     - name: GIT_SYNC_PASSWORD
       valueFrom:
         secretKeyRef:
           name: {{ .Values.dags.gitSync.credentialsSecret | quote }}
           key: GIT_SYNC_PASSWORD
+    - name: GITSYNC_PASSWORD
+      valueFrom:
+        secretKeyRef:
+          name: {{ .Values.dags.gitSync.credentialsSecret | quote }}
+          key: GITSYNC_PASSWORD
     {{- end }}
     - name: GIT_SYNC_REV
       value: {{ .Values.dags.gitSync.rev | quote }}
+    - name: GITSYNC_REF
+      value: {{ .Values.dags.gitSync.ref | quote }}
     - name: GIT_SYNC_BRANCH
       value: {{ .Values.dags.gitSync.branch | quote }}
     - name: GIT_SYNC_REPO
       value: {{ .Values.dags.gitSync.repo | quote }}
+    - name: GITSYNC_REPO
+      value: {{ .Values.dags.gitSync.repo | quote }}
     - name: GIT_SYNC_DEPTH
       value: {{ .Values.dags.gitSync.depth | quote }}
+    - name: GITSYNC_DEPTH
+      value: {{ .Values.dags.gitSync.depth | quote }}
     - name: GIT_SYNC_ROOT
       value: "/git"
+    - name: GITSYNC_ROOT
+      value: "/git"
     - name: GIT_SYNC_DEST
       value: "repo"
+    - name: GITSYNC_LINK
+      value: "repo"
     - name: GIT_SYNC_ADD_USER
       value: "true"
+    - name: GITSYNC_ADD_USER
+      value: "true"
     - name: GIT_SYNC_WAIT
       value: {{ .Values.dags.gitSync.wait | quote }}
+    - name: GITSYNC_PERIOD
+      value: {{ printf "%ss" (toString .Values.dags.gitSync.wait) | quote }}

Review Comment:
   The definition of `GITSYNC_PERIOD` here is useless. From the git-sync README:
   
   ```
   --period <duration>, $GITSYNC_PERIOD
               How long to wait between sync attempts.  This must be at least
               10ms.  This flag obsoletes --wait, but if --wait is specified, it
               will take precedence.  If not specified, this defaults to 10
               seconds ("10s").
   ```
   Which means that the `GIT_SYNC_WAIT` will always take precedence over 
`GITSYNC_PERIOD` and this makes the `GITSYNC_PERIOD` environment variable 
useless.
   However, `GITSYNC_PERIOD` allows us to specify the unit of time that we want 
to wait between syncs (e.g. seconds, milliseconds, minutes, etc.), so it 
doesn't completely useless.
   I suggest that we add a `period` value in the `values.yaml` and if it set, 
we would only create the `GITSYNC_PERIOD` environment variable.



##########
chart/values.yaml:
##########
@@ -121,7 +121,7 @@ images:
     pullPolicy: IfNotPresent
   gitSync:
     repository: registry.k8s.io/git-sync/git-sync
-    tag: v3.6.9
+    tag: v4.0.0

Review Comment:
   I think we should use the `v4.1.0` version of git-sync by default.
   This will fix issues when you use NFS for your DAG's folder. You can see 
more info in the following link: 
https://github.com/kubernetes/git-sync/issues/827



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to