Skip to content

Commit 26f045e

Browse files
committed
chore: switch to ResourceName metrics service helper
1 parent 4282c7f commit 26f045e

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

  • rust/operator-binary/src/controller/build/resource

rust/operator-binary/src/controller/build/resource/service.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ pub fn build_rolegroup_metrics_service(
4747
Service {
4848
metadata: cluster
4949
.object_meta(
50-
metrics_service_name(cluster, role_group_name),
50+
cluster
51+
.resource_names(role_group_name)
52+
.metrics_service_name()
53+
.to_string(),
5154
role_group_name,
5255
)
5356
.with_labels(prometheus_labels())
@@ -66,18 +69,6 @@ pub fn build_rolegroup_metrics_service(
6669
}
6770
}
6871

69-
/// The metrics [`Service`] name, `<cluster>-<role>-<rolegroup>-metrics`.
70-
///
71-
/// [`ResourceNames`](stackable_operator::v2::role_group_utils::ResourceNames) has no metrics
72-
/// service helper, so the `-metrics` suffix is appended to the qualified role-group name (which is
73-
/// also the StatefulSet name).
74-
fn metrics_service_name(cluster: &ValidatedCluster, role_group_name: &RoleGroupName) -> String {
75-
format!(
76-
"{qualified}-metrics",
77-
qualified = cluster.resource_names(role_group_name).stateful_set_name()
78-
)
79-
}
80-
8172
fn metrics_ports() -> Vec<ServicePort> {
8273
vec![ServicePort {
8374
name: Some(METRICS_PORT_NAME.to_string()),

0 commit comments

Comments
 (0)