Skip to content

Commit 3ff927b

Browse files
authored
feat: Enable restart controller (#666)
* feat: Enable restart controller * changelog
1 parent aa17c5e commit 3ff927b

7 files changed

Lines changed: 39 additions & 31 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
99
- Add OPA authorization using the operator-rs `OpaConfig` ([#652]).
1010
- Support objectOverrides using `.spec.objectOverrides`.
1111
See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#665]).
12+
- Enable the [restart-controller](https://docs.stackable.tech/home/nightly/commons-operator/restarter/), so that the Pods are automatically restarted on config changes ([#666]).
1213

1314
### Changed
1415

@@ -17,6 +18,7 @@ All notable changes to this project will be documented in this file.
1718
[#652]: https://github.com/stackabletech/hive-operator/pull/652
1819
[#664]: https://github.com/stackabletech/hive-operator/pull/664
1920
[#665]: https://github.com/stackabletech/hive-operator/pull/665
21+
[#666]: https://github.com/stackabletech/hive-operator/pull/666
2022

2123
## [25.11.0] - 2025-11-07
2224

Cargo.lock

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

Cargo.nix

Lines changed: 15 additions & 15 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/hive-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.101.2", features = ["telemetry", "versioned"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.102.0", features = ["telemetry", "versioned"] }
1515

1616
anyhow = "1.0"
1717
built = { version = "0.8", features = ["chrono", "git2"] }

crate-hashes.json

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

rust/operator-binary/src/controller.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use stackable_operator::{
3737
product_image_selection::{self, ResolvedProductImage},
3838
rbac::build_rbac_resources,
3939
},
40+
constants::RESTART_CONTROLLER_ENABLED_LABEL,
4041
crd::{listener::v1alpha1::Listener, s3},
4142
k8s_openapi::{
4243
DeepMerge,
@@ -502,6 +503,9 @@ pub async fn reconcile_hive(
502503
rolegroup: rolegroup.clone(),
503504
})?;
504505

506+
// Note: The StatefulSet needs to be applied after all ConfigMaps and Secrets it mounts
507+
// to prevent unnecessary Pod restarts.
508+
// See https://github.com/stackabletech/commons-operator/issues/111 for details.
505509
ss_cond_builder.add(
506510
cluster_resources
507511
.add(client, rg_statefulset)
@@ -1099,6 +1103,7 @@ fn build_metastore_rolegroup_statefulset(
10991103
.context(ObjectMissingMetadataForOwnerRefSnafu)?
11001104
.with_recommended_labels(recommended_object_labels)
11011105
.context(MetadataBuildSnafu)?
1106+
.with_label(RESTART_CONTROLLER_ENABLED_LABEL.to_owned())
11021107
.build(),
11031108
spec: Some(StatefulSetSpec {
11041109
pod_management_policy: Some("Parallel".to_string()),

tests/templates/kuttl/smoke/60-assert.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ apiVersion: apps/v1
77
kind: StatefulSet
88
metadata:
99
name: hive-metastore-default
10+
generation: 1 # There should be no unneeded Pod restarts
1011
spec:
1112
template:
1213
spec:

0 commit comments

Comments
 (0)