You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy/helm/airflow-operator/crds/crds.yaml
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -591,10 +591,16 @@ spec:
591
591
- repo
592
592
type: object
593
593
type: array
594
-
dbInit:
595
-
default: true
596
-
description: Whether to execute the database initialization routines (a combination of database initialization, upgrade and migration depending on the Airflow version). Defaults to true to be backwward compatible.
597
-
type: boolean
594
+
databaseInitialization:
595
+
default:
596
+
enabled: true
597
+
description: 'Whether to execute the database initialization routines (a combination of database initialization, upgrade and migration depending on the Airflow version). Defaults to true to be (techincally) backwards-compatible but also safe. WARNING: setting this to false is *unsupported* as subsequent updates to the Airflow cluster may result in broken behaviour due to inconsistent metadata! Do not change the default unless you know what you are doing!'
598
+
properties:
599
+
enabled:
600
+
default: true
601
+
description: Whether to execute the database initialization routines (a combination of database initialization, upgrade and migration depending on the Airflow version). Defaults to true to be backwward compatible.
602
+
type: boolean
603
+
type: object
598
604
exposeConfig:
599
605
default: false
600
606
description: for internal use only - not for production use.
By default, Airflow will run database initialization routines (checking and/or creating the metadata schema and creating an admin user) on start-up.
5
5
These are idempotent and can be run every time as the overhead is minimal.
@@ -14,9 +14,13 @@ metadata:
14
14
name: airflow
15
15
spec:
16
16
clusterConfig:
17
-
dbInit: false # <1>
17
+
databaseInitialization:
18
+
enabled: false # <1>
18
19
----
19
-
<1> Turn off the initialization routine by setting `dbInit` to `false`
20
+
<1> Turn off the initialization routine by setting `databaseInitialization.enabled` to `false`
20
21
21
-
NOTE: The field `dbInit` is `true` by default to be backwards-compatible.
22
+
NOTE: The field `databaseInitialization.enabled` is `true` by default to be backwards-compatible.
22
23
A fresh Airflow cluster cannot be created with this field set to `false` as this results in missing metadata in the Airflow database.
24
+
25
+
WARNING: Setting `databaseInitialization.enabled` to `false` is an unsupported operation as subsequent updates to a running Airflow cluster can result in broken behaviour due to inconsistent metadata.
26
+
Only set `databaseInitialization.enabled` to `false` if you know what you are doing!
Copy file name to clipboardExpand all lines: rust/operator-binary/src/crd/mod.rs
+25-7Lines changed: 25 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -251,9 +251,11 @@ pub mod versioned {
251
251
#[serde(default)]
252
252
pubload_examples:bool,
253
253
254
-
/// Whether to execute the database initialization routines (a combination of database initialization, upgrade and migration depending on the Airflow version). Defaults to true to be backwward compatible.
255
-
#[serde(default = "default_db_init")]
256
-
pubdb_init:bool,
254
+
/// Whether to execute the database initialization routines (a combination of database initialization, upgrade and migration depending on the Airflow version). Defaults to true to be (techincally) backwards-compatible but also safe.
255
+
/// WARNING: setting this to false is *unsupported* as subsequent updates to the Airflow cluster may result in broken behaviour due to inconsistent metadata!
256
+
/// Do not change the default unless you know what you are doing!
/// Whether to execute the database initialization routines (a combination of database initialization, upgrade and migration depending on the Airflow version). Defaults to true to be backwward compatible.
294
+
#[serde(default = "default_db_init")]
295
+
pubenabled:bool,
296
+
}
297
+
298
+
implDefaultforDatabaseInitializationConfig{
299
+
fndefault() -> Self{
300
+
Self{
301
+
enabled:default_db_init(),
302
+
}
303
+
}
304
+
}
305
+
306
+
pubfndefault_db_init() -> bool{
289
307
true
290
308
}
291
309
@@ -585,7 +603,7 @@ impl AirflowRole {
585
603
]);
586
604
}
587
605
AirflowRole::Scheduler => {
588
-
if airflow.spec.cluster_config.db_init{
606
+
if airflow.spec.cluster_config.database_initialization.enabled{
589
607
tracing::info!("Database initialization...");
590
608
command.extend(vec![
591
609
"airflow db migrate".to_string(),
@@ -626,7 +644,7 @@ impl AirflowRole {
626
644
]);
627
645
}
628
646
AirflowRole::Scheduler => {
629
-
if airflow.spec.cluster_config.db_init{
647
+
if airflow.spec.cluster_config.database_initialization.enabled{
630
648
tracing::info!("Database initialization...");
631
649
command.extend(vec![
632
650
// Database initialization is limited to the scheduler, see https://github.com/stackabletech/airflow-operator/issues/259
0 commit comments