ashb commented on a change in pull request #6350: [AIRFLOW-5681] Allow 
specification of a tag or hash for the git_sync init container
URL: https://github.com/apache/airflow/pull/6350#discussion_r358824555
 
 

 ##########
 File path: tests/kubernetes/test_worker_configuration.py
 ##########
 @@ -438,6 +438,30 @@ def test_make_pod_git_sync_credentials_secret(self):
         self.assertIn(password_env, pod.spec.init_containers[0].env,
                       'The password env for git credentials did not get into 
the init container')
 
+    def test_make_pod_git_sync_rev(self):
+        # Tests the pod created with git_sync_credentials_secret will get into 
the init container
+        self.kube_config.git_sync_rev = 'sampletag'
+        self.kube_config.dags_volume_claim = None
+        self.kube_config.dags_volume_host = None
+        self.kube_config.dags_in_image = None
+        self.kube_config.worker_fs_group = None
+        self.kube_config.git_dags_folder_mount_point = 'dags'
+        self.kube_config.git_sync_dest = 'repo'
+        self.kube_config.git_subpath = 'path'
+
+        worker_config = WorkerConfiguration(self.kube_config)
+
+        pod = worker_config.make_pod("default", str(uuid.uuid4()), 
"test_pod_id", "test_dag_id",
+                                     "test_task_id", str(datetime.utcnow()), 
1, "bash -c 'ls /'")
+
+        rev_env = k8s.V1EnvVar(
+            name='GIT_SYNC_REV',
+            value=self.kube_config.git_sync_credentials_secret,
 
 Review comment:
   ```suggestion
               value=self.kube_config.git_sync_rev,
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to