You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/30 20:56:32 UTC

[GitHub] [airflow] kimyen commented on a change in pull request #18272: Allow Airflow UI to create worker pod via Clear > Run

kimyen commented on a change in pull request #18272:
URL: https://github.com/apache/airflow/pull/18272#discussion_r719754802



##########
File path: chart/tests/test_webserver.py
##########
@@ -236,6 +236,38 @@ def test_logs_persistence_adds_volume_and_mount(self, log_persistence_values, ex
                 v["name"] for v in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])
             ]
 
+    @parameterized.expand(
+        [
+            ("1.10.10", False),
+            ("1.10.12", True),
+            ("2.1.0", True),
+        ]
+    )
+    def test_config_volumes_and_mounts(self, af_version, pod_template_file_expected):
+        # setup
+        docs = render_chart(
+            values={"airflowVersion": af_version},
+            show_only=["templates/webserver/webserver-deployment.yaml"],
+        )
+
+        # default config
+        assert {
+            "name": "config",
+            "mountPath": "/opt/airflow/airflow.cfg",
+        } in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])
+
+        # pod_template_file config
+        assert (
+            pod_template_file_expected
+            == (
+                {
+                    "name": "config",
+                    "mountPath": "/opt/airflow/pod_template_file.yaml",
+                }
+                in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])
+            )
+        )

Review comment:
       Use CI suggested format:
   ```suggestion
           assert pod_template_file_expected == (
                   {
                       "name": "config",
                       "mountPath": "/opt/airflow/pod_template_file.yaml",
                   }
                   in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])
           )
   ```




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org