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/11/18 11:42:54 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #19676: Use built-in check-migrations command for Airflow>=2 in helm chart

kaxil commented on a change in pull request #19676:
URL: https://github.com/apache/airflow/pull/19676#discussion_r752161590



##########
File path: chart/templates/_helpers.yaml
##########
@@ -542,7 +542,11 @@ Create the name of the cleanup service account to use
 {{- end -}}
 
 {{ define "wait-for-migrations-command" }}
-  {{/* From Airflow 2.0.0 this can become [airflow, db, check-migrations] */}}
+  {{- if semverCompare ">=2.0.0" .Values.airflowVersion }}

Review comment:
       Should we add a simple test like the following:
   
   ```diff
   diff --git a/chart/tests/test_webserver.py b/chart/tests/test_webserver.py
   index 329e6117d..6f92af2d6 100644
   --- a/chart/tests/test_webserver.py
   +++ b/chart/tests/test_webserver.py
   @@ -137,6 +137,21 @@ class WebserverDeploymentTest(unittest.TestCase):
                "image": "test-registry/test-repo:test-tag",
            } == jmespath.search("spec.template.spec.containers[-1]", docs[0])
   
   +    @parameterized.expand(
   +        [
   +            ("2.0.0", ["airflow", "db", "check-migrations"]),
   +            ("2.1.0", ["airflow", "db", "check-migrations"]),
   +        ],
   +    )
   +    def test_wait_for_migration_airflow_version(self, airflow_version, expected_arg):
   +        docs = render_chart(
   +            values={
   +                "airflowVersion": airflow_version,
   +            },
   +            show_only=["templates/webserver/webserver-deployment.yaml"],
   +        )
   +        assert expected_arg == jmespath.search("spec.template.spec.initContainers[0].args", docs[0])
   +
        def test_should_add_extra_init_containers(self):
            docs = render_chart(
                values={
   ```




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