Skip to content

Commit 0d1c8bb

Browse files
Techassisbernauer
andauthored
feat: Support dynamic image repositories (#961)
* feat: Support dynamic image repositories * test: Add placeholder values to satify roundtrip tests * chore: Add changelog entry * test: Add CRD roundtrip test data * chore: Adjust changelog --------- Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.tech>
1 parent 352806e commit 0d1c8bb

9 files changed

Lines changed: 152 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- 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` ([#961]).
10+
711
### Changed
812

913
- Document Helm deployed RBAC permissions and remove unnecessary permissions ([#953]).
1014
- BREAKING: `configOverrides` now only accepts the known config files (`broker.properties` and
1115
`security.properties` for brokers and `controller.properties` and `security.properties` for
1216
controllers).
1317
Previously, arbitrary file names were silently accepted and ignored ([#960]).
14-
- Bump `stackable-operator` to 0.110.1 and snafu to 0.9 ([#960]).
18+
- Bump `stackable-operator` to 0.111.1 and snafu to 0.9 ([#960], [#961]).
1519

1620
[#953]: https://github.com/stackabletech/kafka-operator/pull/953
1721
[#960]: https://github.com/stackabletech/kafka-operator/pull/960
22+
[#961]: https://github.com/stackabletech/kafka-operator/pull/961
1823

1924
## [26.3.0] - 2026-03-16
2025

Cargo.lock

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

Cargo.nix

Lines changed: 18 additions & 12 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
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/kafka-operator"
1111

1212
[workspace.dependencies]
1313
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.110.1", features = ["crds", "webhook"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.1", features = ["crds", "webhook"] }
1515

1616
anyhow = "1.0"
1717
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: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,8 +2334,9 @@ spec:
23342334
properties:
23352335
custom:
23362336
description: |-
2337-
Overwrite the docker image.
2338-
Specify the full docker image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0`
2337+
Provide a custom container image.
2338+
2339+
Specify the full container image name, e.g. `oci.example.tech/namespace/superset:1.4.1-my-tag`
23392340
type: string
23402341
productVersion:
23412342
description: Version of the product, e.g. `1.4.1`.
@@ -2362,14 +2363,20 @@ spec:
23622363
nullable: true
23632364
type: array
23642365
repo:
2365-
description: Name of the docker repo, e.g. `oci.stackable.tech/sdp`
2366+
description: |-
2367+
The repository on the container image registry where the container image is located, e.g.
2368+
`oci.example.com/namespace`.
2369+
2370+
If not specified, the operator will use the image registry provided via the operator
2371+
environment options.
23662372
nullable: true
23672373
type: string
23682374
stackableVersion:
23692375
description: |-
23702376
Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`.
2371-
If not specified, the operator will use its own version, e.g. `23.4.1`.
2372-
When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image.
2377+
2378+
If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly
2379+
operator or a PR version, it will use the nightly `0.0.0-dev` image.
23732380
nullable: true
23742381
type: string
23752382
type: object

rust/operator-binary/src/crd/mod.rs

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use crate::{
3636
},
3737
};
3838

39-
pub const DOCKER_IMAGE_BASE_NAME: &str = "kafka";
39+
pub const CONTAINER_IMAGE_BASE_NAME: &str = "kafka";
4040
pub const APP_NAME: &str = "kafka";
4141
pub const OPERATOR_NAME: &str = "kafka.stackable.tech";
4242
pub const FIELD_MANAGER: &str = "kafka-operator";
@@ -582,6 +582,7 @@ pub enum MetadataManager {
582582
#[cfg(test)]
583583
mod tests {
584584
use rstest::rstest;
585+
use stackable_operator::versioned::test_utils::RoundtripTestData;
585586

586587
use super::*;
587588

@@ -823,4 +824,85 @@ mod tests {
823824
},
824825
};
825826
}
827+
828+
impl RoundtripTestData for v1alpha1::KafkaClusterSpec {
829+
fn roundtrip_test_data() -> Vec<Self> {
830+
stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {r#"
831+
- image:
832+
productVersion: 1.2.3
833+
pullPolicy: IfNotPresent
834+
clusterOperation:
835+
reconciliationPaused: false
836+
stopped: true
837+
clusterConfig:
838+
metadataManager: kraft
839+
authentication:
840+
- authenticationClass: my-kerberos
841+
authorization:
842+
opa:
843+
configMapName: opa
844+
package: kafka
845+
tls:
846+
internalSecretClass: null
847+
serverSecretClass: tls
848+
vectorAggregatorConfigMapName: vector-aggregator-discovery
849+
controllers:
850+
envOverrides:
851+
COMMON_VAR: role-value
852+
ROLE_VAR: role-value
853+
config:
854+
logging:
855+
enableVectorAgent: true
856+
requestedSecretLifetime: 7d
857+
gracefulShutdownTimeout: 30s
858+
configOverrides:
859+
controller.properties:
860+
log.cleaner.threads: "5"
861+
podOverrides:
862+
spec:
863+
containers:
864+
- name: vector
865+
volumeMounts:
866+
- name: prepared-logs
867+
mountPath: /stackable/log/prepared-logs
868+
volumes:
869+
- name: prepared-logs
870+
configMap:
871+
name: prepared-logs
872+
roleGroups:
873+
default:
874+
replicas: 1
875+
configOverrides:
876+
controller.properties:
877+
log.cleaner.threads: "10"
878+
envOverrides:
879+
COMMON_VAR: group-value
880+
GROUP_VAR: group-value
881+
brokers:
882+
configOverrides:
883+
broker.properties:
884+
compression.type: uncompressed
885+
envOverrides:
886+
COMMON_VAR: role-value
887+
ROLE_VAR: role-value
888+
config:
889+
logging:
890+
enableVectorAgent: true
891+
requestedSecretLifetime: 7d
892+
gracefulShutdownTimeout: 30s
893+
bootstrapListenerClass: cluster-internal
894+
brokerListenerClass: cluster-internal
895+
roleGroups:
896+
default:
897+
replicas: 1
898+
configOverrides:
899+
broker.properties:
900+
compression.type: snappy
901+
envOverrides:
902+
COMMON_VAR: group-value
903+
GROUP_VAR: group-value
904+
"#})
905+
.expect("Failed to parse KafkaClusterSpec YAML")
906+
}
907+
}
826908
}

0 commit comments

Comments
 (0)