Skip to content

Commit 9ef8a4b

Browse files
committed
renamed resource names functions for clarity
1 parent 856af92 commit 9ef8a4b

6 files changed

Lines changed: 16 additions & 13 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn build_rolegroup_config_map(
6666
validated_cluster
6767
.object_meta(
6868
validated_cluster
69-
.resource_names(role_name, role_group_name)
69+
.role_group_resource_names(role_name, role_group_name)
7070
.role_group_config_map()
7171
.to_string(),
7272
validated_cluster.recommended_labels_for(role_name, role_group_name),

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub fn build_executor_template_config_map(
100100
.affinity(&executor_config.affinity)
101101
.service_account_name(
102102
cluster
103-
.rbac_resource_names()
103+
.cluster_resource_names()
104104
.service_account_name()
105105
.to_string(),
106106
)
@@ -156,7 +156,7 @@ pub fn build_executor_template_config_map(
156156
.context(AddVolumeSnafu)?;
157157
pb.add_volumes(volumes::create_volumes(
158158
cluster
159-
.resource_names(&executor_role_name(), &executor_role_group_name())
159+
.role_group_resource_names(&executor_role_name(), &executor_role_group_name())
160160
.role_group_config_map()
161161
.as_ref(),
162162
&executor_config.logging.product_container,
@@ -167,7 +167,10 @@ pub fn build_executor_template_config_map(
167167
pb.add_container(build_logging_container(
168168
resolved_product_image,
169169
vector_log_config,
170-
&cluster.resource_names(&executor_role_name(), &executor_template_role_group_name()),
170+
&cluster.role_group_resource_names(
171+
&executor_role_name(),
172+
&executor_template_role_group_name(),
173+
),
171174
));
172175
}
173176

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ stackable_operator::constant!(NONE_ROLE_GROUP_NAME: RoleGroupName = "none");
2121
pub fn build_service_account(cluster: &ValidatedCluster) -> ServiceAccount {
2222
rbac::build_service_account(
2323
cluster,
24-
&cluster.rbac_resource_names(),
24+
&cluster.cluster_resource_names(),
2525
rbac_labels(cluster),
2626
)
2727
}
@@ -31,7 +31,7 @@ pub fn build_service_account(cluster: &ValidatedCluster) -> ServiceAccount {
3131
pub fn build_role_binding(cluster: &ValidatedCluster) -> RoleBinding {
3232
rbac::build_role_binding(
3333
cluster,
34-
&cluster.rbac_resource_names(),
34+
&cluster.cluster_resource_names(),
3535
rbac_labels(cluster),
3636
)
3737
}

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

Lines changed: 3 additions & 3 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(&ValidatedCluster::role_name(role), role_group_name)
25+
.role_group_resource_names(&ValidatedCluster::role_name(role), role_group_name)
2626
.headless_service_name()
2727
.to_string(),
2828
cluster.recommended_labels(role, role_group_name),
@@ -51,7 +51,7 @@ pub fn build_rolegroup_metrics_service(
5151
metadata: cluster
5252
.object_meta(
5353
cluster
54-
.resource_names(&ValidatedCluster::role_name(role), role_group_name)
54+
.role_group_resource_names(&ValidatedCluster::role_name(role), role_group_name)
5555
.metrics_service_name()
5656
.to_string(),
5757
cluster.recommended_labels(role, role_group_name),
@@ -85,7 +85,7 @@ pub fn stateful_set_service_name(
8585
) -> Option<String> {
8686
Some(
8787
cluster
88-
.resource_names(&ValidatedCluster::role_name(role), role_group_name)
88+
.role_group_resource_names(&ValidatedCluster::role_name(role), role_group_name)
8989
.headless_service_name()
9090
.to_string(),
9191
)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub fn build_server_rolegroup_statefulset(
116116

117117
let mut pb = PodBuilder::new();
118118
let resource_names = validated_cluster
119-
.resource_names(&ValidatedCluster::role_name(airflow_role), role_group_name);
119+
.role_group_resource_names(&ValidatedCluster::role_name(airflow_role), role_group_name);
120120

121121
let recommended_object_labels =
122122
validated_cluster.recommended_labels(airflow_role, role_group_name);
@@ -141,7 +141,7 @@ pub fn build_server_rolegroup_statefulset(
141141
.affinity(&merged_airflow_config.affinity)
142142
.service_account_name(
143143
validated_cluster
144-
.rbac_resource_names()
144+
.cluster_resource_names()
145145
.service_account_name()
146146
.to_string(),
147147
)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,15 @@ impl ValidatedCluster {
328328

329329
/// Type-safe names for the per-cluster RBAC resources: the ServiceAccount shared by all
330330
/// Pods, its (namespaced) RoleBinding, and the operator-deployed ClusterRole it binds.
331-
pub fn rbac_resource_names(&self) -> role_utils::ResourceNames {
331+
pub fn cluster_resource_names(&self) -> role_utils::ResourceNames {
332332
role_utils::ResourceNames {
333333
cluster_name: self.name.clone(),
334334
product_name: product_name(),
335335
}
336336
}
337337

338338
/// Type-safe names for the resources of a role group.
339-
pub fn resource_names(
339+
pub fn role_group_resource_names(
340340
&self,
341341
role_name: &RoleName,
342342
role_group_name: &RoleGroupName,

0 commit comments

Comments
 (0)