Skip to content

Commit 04b8015

Browse files
committed
rename resource name functions
1 parent 20fb778 commit 04b8015

7 files changed

Lines changed: 13 additions & 75 deletions

File tree

Cargo.lock

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub fn build_rolegroup_config_map(
6969
cluster
7070
.object_meta(
7171
cluster
72-
.resource_names(role_group_name)
72+
.role_group_resource_names(role_group_name)
7373
.role_group_config_map()
7474
.to_string(),
7575
role_group_name,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ stackable_operator::constant!(NONE_ROLE_GROUP_NAME: RoleGroupName = "none");
2020
pub fn build_service_account(cluster: &ValidatedCluster) -> ServiceAccount {
2121
rbac::build_service_account(
2222
cluster,
23-
&cluster.rbac_resource_names(),
23+
&cluster.cluster_resource_names(),
2424
rbac_labels(cluster),
2525
)
2626
}
@@ -30,7 +30,7 @@ pub fn build_service_account(cluster: &ValidatedCluster) -> ServiceAccount {
3030
pub fn build_role_binding(cluster: &ValidatedCluster) -> RoleBinding {
3131
rbac::build_role_binding(
3232
cluster,
33-
&cluster.rbac_resource_names(),
33+
&cluster.cluster_resource_names(),
3434
rbac_labels(cluster),
3535
)
3636
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn build_rolegroup_headless_service(
2222
metadata: cluster
2323
.object_meta(
2424
cluster
25-
.resource_names(role_group_name)
25+
.role_group_resource_names(role_group_name)
2626
.headless_service_name()
2727
.to_string(),
2828
role_group_name,
@@ -50,7 +50,7 @@ pub fn build_rolegroup_metrics_service(
5050
metadata: cluster
5151
.object_meta(
5252
cluster
53-
.resource_names(role_group_name)
53+
.role_group_resource_names(role_group_name)
5454
.metrics_service_name()
5555
.to_string(),
5656
role_group_name,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub(crate) fn build_node_rolegroup_statefulset(
180180
let git_sync_resources = &rg.config.git_sync_resources;
181181

182182
// Type-safe names for this role group's resources (StatefulSet, ConfigMap, headless Service).
183-
let resource_names = cluster.resource_names(role_group_name);
183+
let resource_names = cluster.role_group_resource_names(role_group_name);
184184

185185
// The validated, merged `NifiConfig` is the single source of truth; the ConfigMap builder
186186
// sources the same `rg.config`.
@@ -603,7 +603,7 @@ pub(crate) fn build_node_rolegroup_statefulset(
603603
&cluster.cluster_config.server_tls_secret_class,
604604
&KEYSTORE_VOLUME_NAME,
605605
[cluster
606-
.resource_names(role_group_name)
606+
.role_group_resource_names(role_group_name)
607607
.metrics_service_name()
608608
.to_string()],
609609
SecretFormat::TlsPkcs12,
@@ -643,7 +643,7 @@ pub(crate) fn build_node_rolegroup_statefulset(
643643
.context(AddVolumeSnafu)?
644644
.service_account_name(
645645
cluster
646-
.rbac_resource_names()
646+
.cluster_resource_names()
647647
.service_account_name()
648648
.to_string(),
649649
)

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,18 @@ impl ValidatedCluster {
261261

262262
/// Type-safe names for the per-cluster RBAC resources: the ServiceAccount shared by all
263263
/// Pods, its (namespaced) RoleBinding, and the operator-deployed ClusterRole it binds.
264-
pub fn rbac_resource_names(&self) -> role_utils::ResourceNames {
264+
pub fn cluster_resource_names(&self) -> role_utils::ResourceNames {
265265
role_utils::ResourceNames {
266266
cluster_name: self.name.clone(),
267267
product_name: product_name(),
268268
}
269269
}
270270

271271
/// Type-safe names for the resources of a given role group.
272-
pub(crate) fn resource_names(&self, role_group_name: &RoleGroupName) -> ResourceNames {
272+
pub(crate) fn role_group_resource_names(
273+
&self,
274+
role_group_name: &RoleGroupName,
275+
) -> ResourceNames {
273276
ResourceNames {
274277
cluster_name: self.name.clone(),
275278
role_name: Self::role_name(),

rust/operator-binary/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ async fn main() -> anyhow::Result<()> {
6767
Command::Run(RunArguments {
6868
operator_environment,
6969
watch_namespace,
70-
product_config: _,
7170
maintenance,
7271
common,
7372
}) => {

0 commit comments

Comments
 (0)