This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 58cce7d88b Add airflow db migrate command to migrateDatabaseJob 
(#34178)
58cce7d88b is described below

commit 58cce7d88b1d57e815e04e5460eaaa71173af14a
Author: Kim Minwoo <[email protected]>
AuthorDate: Sun Sep 10 20:43:29 2023 +0900

    Add airflow db migrate command to migrateDatabaseJob (#34178)
    
    * Add airflow db migrate command to migrateDatabaseJob
    
    * Break a long line into multiple lines
---
 chart/values.schema.json                            | 2 +-
 chart/values.yaml                                   | 8 +++++---
 helm_tests/airflow_aux/test_migrate_database_job.py | 1 +
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/chart/values.schema.json b/chart/values.schema.json
index 47a8465767..395bea9b4a 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -3933,7 +3933,7 @@
                     "default": [
                         "bash",
                         "-c",
-                        "exec \\\nairflow {{ semverCompare \">=2.0.0\" 
.Values.airflowVersion | ternary \"db upgrade\" \"upgradedb\" }}"
+                        "exec \\\nairflow {{ semverCompare \">=2.7.0\" 
.Values.airflowVersion | ternary \"db migrate\" (semverCompare \">=2.0.0\" 
.Values.airflowVersion | ternary \"db upgrade\" \"upgradedb\") }}"
                     ]
                 },
                 "annotations": {
diff --git a/chart/values.yaml b/chart/values.yaml
index 38bf64c174..5f0732afc8 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -1018,10 +1018,12 @@ migrateDatabaseJob:
   args:
     - "bash"
     - "-c"
-    # The format below is necessary to get `helm lint` happy
-    - |-
+    - >-
       exec \
-      airflow {{ semverCompare ">=2.0.0" .Values.airflowVersion | ternary "db 
upgrade" "upgradedb" }}
+
+      airflow {{ semverCompare ">=2.7.0" .Values.airflowVersion
+      | ternary "db migrate" (semverCompare ">=2.0.0" .Values.airflowVersion
+      | ternary "db upgrade" "upgradedb") }}
 
   # Annotations on the database migration pod
   annotations: {}
diff --git a/helm_tests/airflow_aux/test_migrate_database_job.py 
b/helm_tests/airflow_aux/test_migrate_database_job.py
index e08e7c32d7..6f5382cda7 100644
--- a/helm_tests/airflow_aux/test_migrate_database_job.py
+++ b/helm_tests/airflow_aux/test_migrate_database_job.py
@@ -277,6 +277,7 @@ class TestMigrateDatabaseJob:
         [
             ("1.10.14", "airflow upgradedb"),
             ("2.0.2", "airflow db upgrade"),
+            ("2.7.1", "airflow db migrate"),
         ],
     )
     def test_default_command_and_args_airflow_version(self, airflow_version, 
expected_arg):

Reply via email to