Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/cli/cli_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def _check(value):
("-t", "--migration-wait-timeout"),
help="timeout to wait for db to migrate ",
type=int,
default=0,
default=60,
)

# webserver
Expand Down
1 change: 1 addition & 0 deletions chart/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ Create the name of the cleanup service account to use
- airflow
- db
- check-migrations
- --migration-wait-timeout={{ .Values.images.migrationsWaitTimeout }}
{{- else }}
- python
- -c
Expand Down
4 changes: 2 additions & 2 deletions chart/tests/test_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def test_should_add_extra_containers(self):

@parameterized.expand(
[
("2.0.0", ["airflow", "db", "check-migrations"]),
("2.1.0", ["airflow", "db", "check-migrations"]),
("2.0.0", ["airflow", "db", "check-migrations", "--migration-wait-timeout=60"]),
("2.1.0", ["airflow", "db", "check-migrations", "--migration-wait-timeout=60"]),
("1.10.2", ["python", "-c"]),
],
)
Expand Down
6 changes: 6 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@
"x-docsSection": "Images",
"default": false
},
"migrationsWaitTimeout": {
"description": "The time (in seconds) to wait for the DB migrations to complete.",
"type": "number",
"x-docsSection": "Images",
"default": 60
},
"pod_template": {
"description": "Configuration of the pod_template image.",
"type": "object",
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ images:
# will use the images from 'defaultAirflowRepository:defaultAirflowTag' values
# to run and wait for DB migrations .
useDefaultImageForMigration: false
# timeout (in seconds) for airflow-migrations to complete
migrationsWaitTimeout: 60
pod_template:
repository: ~
tag: ~
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/commands/test_db_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_cli_resetdb(self, mock_resetdb):
def test_cli_check_migrations(self, mock_wait_for_migrations):
db_command.check_migrations(self.parser.parse_args(['db', 'check-migrations']))

mock_wait_for_migrations.assert_called_once_with(timeout=0)
mock_wait_for_migrations.assert_called_once_with(timeout=60)

@mock.patch("airflow.cli.commands.db_command.db.upgradedb")
def test_cli_upgradedb(self, mock_upgradedb):
Expand Down