From 13730c615879ab22701ece13e9156520d4a205a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCller?= Date: Mon, 23 Nov 2026 10:38:19 +0100 Subject: [PATCH] chore: use label constant from operator-rs --- rust/operator-binary/src/restart_controller/statefulset.rs | 4 +++- rust/operator-binary/src/webhooks/restarter_mutate_sts.rs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rust/operator-binary/src/restart_controller/statefulset.rs b/rust/operator-binary/src/restart_controller/statefulset.rs index 8e3e8749..ec4ce942 100644 --- a/rust/operator-binary/src/restart_controller/statefulset.rs +++ b/rust/operator-binary/src/restart_controller/statefulset.rs @@ -10,6 +10,7 @@ use serde_json::json; use snafu::{ResultExt, Snafu}; use stackable_operator::{ client::Client, + constants::RESTART_CONTROLLER_ENABLED_LABEL, k8s_openapi::api::{ apps::v1::StatefulSet, core::v1::{ConfigMap, EnvFromSource, EnvVar, PodSpec, Secret, Volume}, @@ -190,7 +191,8 @@ pub async fn start( sts_store, watcher( stses, - watcher::Config::default().labels("restarter.stackable.tech/enabled=true"), + watcher::Config::default() + .labels(&RESTART_CONTROLLER_ENABLED_LABEL.to_string()), ), ) .applied_objects(), diff --git a/rust/operator-binary/src/webhooks/restarter_mutate_sts.rs b/rust/operator-binary/src/webhooks/restarter_mutate_sts.rs index a00548ed..afa08303 100644 --- a/rust/operator-binary/src/webhooks/restarter_mutate_sts.rs +++ b/rust/operator-binary/src/webhooks/restarter_mutate_sts.rs @@ -3,6 +3,7 @@ use std::{collections::BTreeMap, ops::Not, sync::Arc}; use json_patch::{AddOperation, Patch, PatchOperation, jsonptr::PointerBuf}; use stackable_operator::{ builder::meta::ObjectMetaBuilder, + constants::RESTART_CONTROLLER_ENABLED_LABEL, k8s_openapi::{ api::{ admissionregistration::v1::{ @@ -77,8 +78,8 @@ fn get_sts_restarter_mutating_webhook_configuration() -> MutatingWebhookConfigur // label set to `true`. object_selector: Some(LabelSelector { match_labels: Some(BTreeMap::from([( - "restarter.stackable.tech/enabled".to_owned(), - "true".to_owned(), + RESTART_CONTROLLER_ENABLED_LABEL.key().to_string(), + RESTART_CONTROLLER_ENABLED_LABEL.value().to_string(), )])), match_expressions: None, }),