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

jscheffl pushed a commit to branch chart/v1-2x-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/chart/v1-2x-test by this push:
     new 0b5c98ce423 [chart/v1-2x-test] Chart: fix default args/command for 
databaseCleanup (#63821) (#64506)
0b5c98ce423 is described below

commit 0b5c98ce4230ae0a47e8b56a0b7866c1eea852bc
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Mar 30 23:18:16 2026 +0200

    [chart/v1-2x-test] Chart: fix default args/command for databaseCleanup 
(#63821) (#64506)
    
    (cherry picked from commit 981e80bdf1cf2ddc4a697221a424bd7efd955b44)
    
    Co-authored-by: Aakcht <[email protected]>
    Co-authored-by: Jens Scheffler <[email protected]>
---
 chart/values.schema.json                                      |  5 ++---
 chart/values.yaml                                             |  4 ++--
 .../tests/helm_tests/airflow_aux/test_database_cleanup.py     | 11 +++++------
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/chart/values.schema.json b/chart/values.schema.json
index df49e96df38..c94689aa0dd 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -10271,9 +10271,7 @@
                     "items": {
                         "type": "string"
                     },
-                    "default": [
-                        "bash"
-                    ]
+                    "default": null
                 },
                 "args": {
                     "description": "Args to use when running the database 
cleanup cronjob (templated).",
@@ -10285,6 +10283,7 @@
                         "type": "string"
                     },
                     "default": [
+                        "bash",
                         "-c",
                         "CLEAN_TS=$(date -d \"-{{ 
.Values.databaseCleanup.retentionDays }} days\" +\"%Y-%m-%dT%H:%M:%S\"); echo 
\"Cleaning up metadata DB entries older than ${CLEAN_TS}\"; exec airflow db 
clean --clean-before-timestamp \"${CLEAN_TS}\" --yes {{- if 
.Values.databaseCleanup.skipArchive }} --skip-archive{{ end }} {{- if 
.Values.databaseCleanup.verbose }} --verbose{{ end }} {{- with 
.Values.databaseCleanup.batchSize }} --batch-size {{ . }}{{ end }} {{- with 
.Values.databaseCle [...]
                     ]
diff --git a/chart/values.yaml b/chart/values.yaml
index 32f7ed9883c..68f97bc05d9 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -3533,10 +3533,10 @@ databaseCleanup:
   # Run every week on Sunday at midnight (templated).
   schedule: "0 0 * * 0"
   # Command to use when running the database cleanup cronjob (templated).
-  command:
-    - "bash"
+  command: ~
   # Args to use when running the database cleanup cronjob (templated).
   args:
+    - "bash"
     - "-c"
     - >-
       CLEAN_TS=$(date -d "-{{ .Values.databaseCleanup.retentionDays }} days" 
+"%Y-%m-%dT%H:%M:%S");
diff --git a/helm-tests/tests/helm_tests/airflow_aux/test_database_cleanup.py 
b/helm-tests/tests/helm_tests/airflow_aux/test_database_cleanup.py
index 14f86cff77a..4ad2e990d6b 100644
--- a/helm-tests/tests/helm_tests/airflow_aux/test_database_cleanup.py
+++ b/helm-tests/tests/helm_tests/airflow_aux/test_database_cleanup.py
@@ -188,6 +188,7 @@ class TestDatabaseCleanup:
         )
 
         assert 
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].args", 
docs[0]) == [
+            "bash",
             "-c",
             'CLEAN_TS=$(date -d "-10 days" +"%Y-%m-%dT%H:%M:%S"); echo 
"Cleaning up metadata DB entries older than ${CLEAN_TS}"; exec airflow db clean 
--clean-before-timestamp "${CLEAN_TS}" --yes --verbose',
         ]
@@ -198,10 +199,9 @@ class TestDatabaseCleanup:
             
show_only=["templates/database-cleanup/database-cleanup-cronjob.yaml"],
         )
 
-        assert 
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].command", 
docs[0]) == [
-            "bash"
-        ]
+        assert 
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].command", 
docs[0]) is None
         assert 
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].args", 
docs[0]) == [
+            "bash",
             "-c",
             'CLEAN_TS=$(date -d "-90 days" +"%Y-%m-%dT%H:%M:%S"); echo 
"Cleaning up metadata DB entries older than ${CLEAN_TS}"; exec airflow db clean 
--clean-before-timestamp "${CLEAN_TS}" --yes --verbose',
         ]
@@ -241,10 +241,9 @@ class TestDatabaseCleanup:
             
show_only=["templates/database-cleanup/database-cleanup-cronjob.yaml"],
         )
 
-        assert 
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].command", 
docs[0]) == [
-            "bash"
-        ]
+        assert 
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].command", 
docs[0]) is None
         assert 
jmespath.search("spec.jobTemplate.spec.template.spec.containers[0].args", 
docs[0]) == [
+            "bash",
             "-c",
             f'CLEAN_TS=$(date -d "-{retention} days" +"%Y-%m-%dT%H:%M:%S"); 
echo "Cleaning up metadata DB entries older than ${{CLEAN_TS}}"; exec airflow 
db clean --clean-before-timestamp "${{CLEAN_TS}}" --yes{command_args}',
         ]

Reply via email to