From 5670c55128ad8738f496eda887b7aae98ba2b770 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 16 Jan 2026 13:41:54 +0100 Subject: [PATCH 1/2] fix: Set restarter label on StatefulSets, not on Pods --- CHANGELOG.md | 3 ++- rust/operator-binary/src/resource/statefulset.rs | 3 ++- .../templates/kuttl/smoke-kraft/30-assert.yaml.j2 | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d65a799..9aaabba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file. - Support objectOverrides using `.spec.objectOverrides`. See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#927]). - Added experimental support for `4.1.1` ([#929]) -- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#930]). +- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#930], [#XXX]). ### Changed @@ -29,6 +29,7 @@ All notable changes to this project will be documented in this file. [#927]: https://github.com/stackabletech/kafka-operator/pull/927 [#929]: https://github.com/stackabletech/kafka-operator/pull/929 [#930]: https://github.com/stackabletech/kafka-operator/pull/930 +[#XXX]: https://github.com/stackabletech/kafka-operator/pull/XXX ## [25.11.0] - 2025-11-07 diff --git a/rust/operator-binary/src/resource/statefulset.rs b/rust/operator-binary/src/resource/statefulset.rs index 3063533b..10ae0366 100644 --- a/rust/operator-binary/src/resource/statefulset.rs +++ b/rust/operator-binary/src/resource/statefulset.rs @@ -427,7 +427,6 @@ pub fn build_broker_rolegroup_statefulset( let metadata = ObjectMetaBuilder::new() .with_recommended_labels(recommended_object_labels) .context(MetadataBuildSnafu)? - .with_label(RESTART_CONTROLLER_ENABLED_LABEL.to_owned()) .build(); if let Some(listener_class) = merged_config.listener_class() { @@ -525,6 +524,7 @@ pub fn build_broker_rolegroup_statefulset( &rolegroup_ref.role_group, )) .context(MetadataBuildSnafu)? + .with_label(RESTART_CONTROLLER_ENABLED_LABEL.to_owned()) .build(), spec: Some(StatefulSetSpec { pod_management_policy: Some("Parallel".to_string()), @@ -836,6 +836,7 @@ pub fn build_controller_rolegroup_statefulset( &rolegroup_ref.role_group, )) .context(MetadataBuildSnafu)? + .with_label(RESTART_CONTROLLER_ENABLED_LABEL.to_owned()) .build(), spec: Some(StatefulSetSpec { pod_management_policy: Some("Parallel".to_string()), diff --git a/tests/templates/kuttl/smoke-kraft/30-assert.yaml.j2 b/tests/templates/kuttl/smoke-kraft/30-assert.yaml.j2 index 5bd04442..c93294b3 100644 --- a/tests/templates/kuttl/smoke-kraft/30-assert.yaml.j2 +++ b/tests/templates/kuttl/smoke-kraft/30-assert.yaml.j2 @@ -7,6 +7,9 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: test-kafka-broker-default + generation: 1 # There should be no unneeded Pod restarts + labels: + restarter.stackable.tech/enabled: "true" status: readyReplicas: 1 replicas: 1 @@ -15,6 +18,9 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: test-kafka-broker-automatic-log-config + generation: 1 # There should be no unneeded Pod restarts + labels: + restarter.stackable.tech/enabled: "true" status: readyReplicas: 1 replicas: 1 @@ -23,6 +29,9 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: test-kafka-broker-custom-log-config + generation: 1 # There should be no unneeded Pod restarts + labels: + restarter.stackable.tech/enabled: "true" status: readyReplicas: 1 replicas: 1 @@ -31,6 +40,9 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: test-kafka-controller-automatic-log-config + generation: 1 # There should be no unneeded Pod restarts + labels: + restarter.stackable.tech/enabled: "true" status: readyReplicas: 1 replicas: 1 @@ -39,6 +51,9 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: test-kafka-controller-custom-log-config + generation: 1 # There should be no unneeded Pod restarts + labels: + restarter.stackable.tech/enabled: "true" status: readyReplicas: 1 replicas: 1 From 451ebe792ef080cec5d60f67395e87d7361876bd Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 16 Jan 2026 13:47:29 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aaabba7..f31dfd8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file. - Support objectOverrides using `.spec.objectOverrides`. See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#927]). - Added experimental support for `4.1.1` ([#929]) -- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#930], [#XXX]). +- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#930], [#932]). ### Changed @@ -29,7 +29,7 @@ All notable changes to this project will be documented in this file. [#927]: https://github.com/stackabletech/kafka-operator/pull/927 [#929]: https://github.com/stackabletech/kafka-operator/pull/929 [#930]: https://github.com/stackabletech/kafka-operator/pull/930 -[#XXX]: https://github.com/stackabletech/kafka-operator/pull/XXX +[#932]: https://github.com/stackabletech/kafka-operator/pull/932 ## [25.11.0] - 2025-11-07