Skip to content

Commit 34991ab

Browse files
Techassisbernauer
andauthored
feat: Support dynamic image repositories (#784)
* feat: Support dynamic image repositories * test: Add placeholder values to satify roundtrip tests * test: Use correct parameter order * fix: Bump rustls-webpki to 0.103.13 to negate RUSTSEC-2026-0104 * test: Add CRD roundtrip test data * Don't test git-sync roundtrip * Increase test coverage * chore: Add changelog entry --------- Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech>
1 parent 50b6b10 commit 34991ab

9 files changed

Lines changed: 270 additions & 65 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66

7+
- BREAKING: Add required CLI argument and env var to set the image repository used to construct final product image names: `IMAGE_REPOSITORY` (`--image-repository`), eg. `oci.example.org/my/namespace` ([#784]).
78
- Support for passing CAs to GitSync ([#750]).
89
- Support setting `clientAuthenticationMethod` for OIDC authentication. The value is passed through to the Flask-AppBuilder config as `token_endpoint_auth_method` ([#765]).
910

@@ -31,6 +32,7 @@
3132
[#775]: https://github.com/stackabletech/airflow-operator/pull/775
3233
[#777]: https://github.com/stackabletech/airflow-operator/pull/777
3334
[#754]: https://github.com/stackabletech/airflow-operator/pull/754
35+
[#784]: https://github.com/stackabletech/airflow-operator/pull/784
3436

3537
## [26.3.0] - 2026-03-16
3638

Cargo.lock

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 20 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ product-config = { git = "https://github.com/stackabletech/product-config.git",
1414
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = [
1515
"crds",
1616
"webhook",
17-
], tag = "stackable-operator-0.110.1" }
17+
], tag = "stackable-operator-0.111.0" }
1818

1919
anyhow = "1.0"
2020
built = { version = "0.8", features = ["chrono", "git2"] }

crate-hashes.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extra/crds.yaml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,8 +2576,9 @@ spec:
25762576
properties:
25772577
custom:
25782578
description: |-
2579-
Overwrite the docker image.
2580-
Specify the full docker image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0`
2579+
Provide a custom container image.
2580+
2581+
Specify the full container image name, e.g. `oci.example.tech/namespace/superset:1.4.1-my-tag`
25812582
type: string
25822583
productVersion:
25832584
description: Version of the product, e.g. `1.4.1`.
@@ -2604,14 +2605,20 @@ spec:
26042605
nullable: true
26052606
type: array
26062607
repo:
2607-
description: Name of the docker repo, e.g. `oci.stackable.tech/sdp`
2608+
description: |-
2609+
The repository on the container image registry where the container image is located, e.g.
2610+
`oci.example.com/namespace`.
2611+
2612+
If not specified, the operator will use the image registry provided via the operator
2613+
environment options.
26082614
nullable: true
26092615
type: string
26102616
stackableVersion:
26112617
description: |-
26122618
Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`.
2613-
If not specified, the operator will use its own version, e.g. `23.4.1`.
2614-
When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image.
2619+
2620+
If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly
2621+
operator or a PR version, it will use the nightly `0.0.0-dev` image.
26152622
nullable: true
26162623
type: string
26172624
type: object
@@ -8735,8 +8742,9 @@ spec:
87358742
properties:
87368743
custom:
87378744
description: |-
8738-
Overwrite the docker image.
8739-
Specify the full docker image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0`
8745+
Provide a custom container image.
8746+
8747+
Specify the full container image name, e.g. `oci.example.tech/namespace/superset:1.4.1-my-tag`
87408748
type: string
87418749
productVersion:
87428750
description: Version of the product, e.g. `1.4.1`.
@@ -8763,14 +8771,20 @@ spec:
87638771
nullable: true
87648772
type: array
87658773
repo:
8766-
description: Name of the docker repo, e.g. `oci.stackable.tech/sdp`
8774+
description: |-
8775+
The repository on the container image registry where the container image is located, e.g.
8776+
`oci.example.com/namespace`.
8777+
8778+
If not specified, the operator will use the image registry provided via the operator
8779+
environment options.
87678780
nullable: true
87688781
type: string
87698782
stackableVersion:
87708783
description: |-
87718784
Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`.
8772-
If not specified, the operator will use its own version, e.g. `23.4.1`.
8773-
When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image.
8785+
8786+
If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly
8787+
operator or a PR version, it will use the nightly `0.0.0-dev` image.
87748788
nullable: true
87758789
type: string
87768790
type: object

rust/operator-binary/src/airflow_controller.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use stackable_operator::{
2929
},
3030
},
3131
},
32+
cli::OperatorEnvironmentOptions,
3233
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
3334
commons::{
3435
product_image_selection::{self, ResolvedProductImage},
@@ -119,13 +120,14 @@ use crate::{
119120
};
120121

121122
pub const AIRFLOW_CONTROLLER_NAME: &str = "airflowcluster";
122-
pub const DOCKER_IMAGE_BASE_NAME: &str = "airflow";
123+
pub const CONTAINER_IMAGE_BASE_NAME: &str = "airflow";
123124
pub const AIRFLOW_FULL_CONTROLLER_NAME: &str =
124125
concatcp!(AIRFLOW_CONTROLLER_NAME, '.', OPERATOR_NAME);
125126

126127
pub struct Ctx {
127128
pub client: stackable_operator::client::Client,
128129
pub product_config: ProductConfigManager,
130+
pub operator_environment: OperatorEnvironmentOptions,
129131
}
130132

131133
#[derive(Snafu, Debug, EnumDiscriminants)]
@@ -387,7 +389,11 @@ pub async fn reconcile_airflow(
387389
let resolved_product_image = airflow
388390
.spec
389391
.image
390-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
392+
.resolve(
393+
CONTAINER_IMAGE_BASE_NAME,
394+
&ctx.operator_environment.image_repository,
395+
crate::built_info::PKG_VERSION,
396+
)
391397
.context(ResolveProductImageSnafu)?;
392398

393399
let cluster_operation_cond_builder =

0 commit comments

Comments
 (0)