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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

## [Unreleased]

### Fixed

- Set `AIRFLOW__API__EXPOSE_CONFIG` instead of the deprecated
`AIRFLOW__WEBSERVER__EXPOSE_CONFIG`. Airflow moved the option to the `[api]` section in 3.0.1 and
only still honours the old name through a deprecation shim, which logs a warning on every config
read.
See [Airflow's deprecated options table](https://github.com/apache/airflow/blob/3.3.2/shared/configuration/src/airflow_shared/configuration/parser.py#L261) for the move ([#901]).

### Removed

- BREAKING: Remove the Airflow 2.x specific code paths.
The OPA settings were the only ones that Airflow 2 read from `webserver_config.py`, so
`AUTH_OPA_REQUEST_URL`, `AUTH_OPA_CACHE_TTL_IN_SEC`, `AUTH_OPA_CACHE_MAXSIZE` and
`AUTH_OPA_REQUEST_TIMEOUT` are no longer known `configOverrides` keys for
`webserver_config.py`. Delete such entries. Unknown keys are written out verbatim, so a
left-over `AUTH_OPA_REQUEST_URL` renders as unquoted Python and the webserver fails to start.
Airflow 3 reads the OPA settings from the `AIRFLOW__CORE__AUTH_OPA_*` environment variables,
which the operator sets from `spec.clusterConfig.authorization.opa` ([#901]).

[#901]: https://github.com/stackabletech/airflow-operator/pull/901

## [26.11.0] - 2026-11-20

## [26.11.0-rc1] - 2026-11-19
Expand Down
8 changes: 0 additions & 8 deletions extra/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5853,10 +5853,6 @@ spec:
only entry in the list if used: combining it with other entries is rejected, since it
would silently degrade to trusting only those other entries.

On Airflow 3.x this restricts trust to the listed peers. On 2.x it only switches
forwarded-header handling on or off: any non-empty list trusts every peer, the same as
`*`, since Airflow 2.x has no way to restrict it further.

Leave this empty (the default) and forwarded headers are ignored entirely.
items:
type: string
Expand Down Expand Up @@ -12234,10 +12230,6 @@ spec:
only entry in the list if used: combining it with other entries is rejected, since it
would silently degrade to trusting only those other entries.

On Airflow 3.x this restricts trust to the listed peers. On 2.x it only switches
forwarded-header handling on or off: any non-empty list trusts every peer, the same as
`*`, since Airflow 2.x has no way to restrict it further.

Leave this empty (the default) and forwarded headers are ignored entirely.
items:
type: string
Expand Down
70 changes: 14 additions & 56 deletions rust/operator-binary/src/controller/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ mod tests {

#[rstest]
#[case::airflow_3x("3.3.2")]
#[case::airflow_2x("2.9.3")]
fn admin_password_is_not_traced(#[case] product_version: &str) {
let cluster = validated_cluster_with(
"celeryExecutors",
Expand Down Expand Up @@ -717,71 +716,30 @@ mod tests {
assert_eq!(env.get("FORWARDED_ALLOW_IPS"), None);
}

/// Builds a 2.x Celery-executor cluster whose webserver trusts the given reverse proxies.
fn cluster_with_trusted_proxies_on_airflow_2x(trusted_proxies: &[&str]) -> ValidatedCluster {
let trusted_proxies: Vec<yaml_serde::Value> = trusted_proxies
.iter()
.map(|proxy| yaml_serde::Value::String((*proxy).to_owned()))
.collect();

validated_cluster_with(
"celeryExecutors",
"{config: {}, roleGroups: {}}",
move |cluster| {
cluster["spec"]["image"]["productVersion"] = yaml_serde::Value::from("2.9.3");
cluster["spec"]["webservers"]
.as_mapping_mut()
.expect("the webservers role is a mapping")
.insert(
"roleConfig".into(),
yaml_serde::Value::Mapping(yaml_serde::Mapping::from_iter([(
yaml_serde::Value::String("trustedProxies".to_owned()),
yaml_serde::Value::Sequence(trusted_proxies.clone()),
)])),
);
},
)
}

/// Airflow moved `expose_config` from the `[webserver]` to the `[api]` section and only
/// honours the old name through a deprecation shim, which logs a warning on every config
/// read, so the operator must set the `[api]` variable.
#[test]
fn trusted_proxies_enables_proxy_fix_on_airflow_2x() {
let cluster = cluster_with_trusted_proxies_on_airflow_2x(&["10.244.0.0/16"]);

let args = airflow_container_args(&cluster, "my-airflow-webserver-default");
assert!(args.contains("airflow webserver &"), "args were:\n{args}");
assert!(!args.contains("--proxy-headers"), "args were:\n{args}");

fn expose_config_sets_the_api_env_var() {
let mut cluster = celery_executor_cluster();
cluster.cluster_config.expose_config = true;
let env = airflow_container_env(&cluster, "my-airflow-webserver-default");
assert_eq!(env.get("FORWARDED_ALLOW_IPS"), None);
assert_eq!(
env.get("AIRFLOW__WEBSERVER__ENABLE_PROXY_FIX"),
Some(&"True".to_owned())
);
assert_eq!(
env.get("AIRFLOW__WEBSERVER__PROXY_FIX_X_FOR"),
Some(&"1".to_owned())
);
}

#[test]
fn wildcard_trusted_proxies_enables_proxy_fix_on_airflow_2x() {
let cluster = cluster_with_trusted_proxies_on_airflow_2x(&["*"]);

let env = airflow_container_env(&cluster, "my-airflow-webserver-default");
assert_eq!(
env.get("AIRFLOW__WEBSERVER__ENABLE_PROXY_FIX"),
env.get("AIRFLOW__API__EXPOSE_CONFIG"),
Some(&"True".to_owned())
);
assert_eq!(env.get("AIRFLOW__WEBSERVER__EXPOSE_CONFIG"), None);
}

/// No `trustedProxies` means no `ProxyFix` on Airflow 2.x either.
/// Airflow defaults `expose_config` to `False`, so the operator leaves the variable unset
/// rather than spelling the default out.
#[test]
fn no_proxy_fix_without_trusted_proxies_on_airflow_2x() {
let cluster = cluster_with_trusted_proxies_on_airflow_2x(&[]);

fn no_expose_config_env_var_when_disabled() {
let cluster = celery_executor_cluster();
let env = airflow_container_env(&cluster, "my-airflow-webserver-default");
assert_eq!(env.get("AIRFLOW__WEBSERVER__ENABLE_PROXY_FIX"), None);
assert_eq!(env.get("AIRFLOW__WEBSERVER__PROXY_FIX_X_FOR"), None);

assert_eq!(env.get("AIRFLOW__API__EXPOSE_CONFIG"), None);
}

/// A cluster with the given `spec.clusterConfig.volumeMounts` (as standalone YAML).
Expand Down
Loading
Loading