zezaeoh commented on code in PR #59418:
URL: https://github.com/apache/airflow/pull/59418#discussion_r2624976256


##########
helm-tests/tests/helm_tests/airflow_aux/test_configmap.py:
##########
@@ -302,6 +302,40 @@ def test_execution_api_server_url(
                 "execution_api_server_url should not be set for Airflow 2.x 
versions"
             )
 
+    @pytest.mark.parametrize(
+        ("git_sync_enabled", "ssh_key_secret", "ssh_key", "expected_volume"),
+        [
+            (True, "my-secret", None, True),
+            (True, None, "my-key", True),
+            (True, "my-secret", "my-key", True),
+            (True, None, None, False),
+            (False, "my-secret", None, False),
+            (False, None, "my-key", False),
+        ],
+    )
+    def test_pod_template_git_sync_ssh_key_volume(
+        self, git_sync_enabled, ssh_key_secret, ssh_key, expected_volume
+    ):
+        dag_values = {"gitSync": {"enabled": git_sync_enabled}}
+        if ssh_key_secret:
+            dag_values["gitSync"]["sshKeySecret"] = ssh_key_secret
+        if ssh_key:
+            dag_values["gitSync"]["sshKey"] = ssh_key
+
+        docs = render_chart(
+            values={
+                "executor": "KubernetesExecutor",
+                "dags": dag_values,
+            },
+            show_only=["templates/configmaps/configmap.yaml"],
+        )
+
+        pod_template_file = jmespath.search('data."pod_template_file.yaml"', 
docs[0])
+        if expected_volume:
+            assert "git-sync-ssh-key" in pod_template_file
+        else:
+            assert "git-sync-ssh-key" not in pod_template_file

Review Comment:
   
https://github.com/apache/airflow/pull/59418/changes/6c62a0339a640a914aeafa723750ff9229614e87



-- 
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