@@ -138,15 +138,15 @@ impl ValidatedCluster {
138138
139139 /// Type-safe names for the per-cluster RBAC resources: the ServiceAccount shared by all
140140 /// Pods, its (namespaced) RoleBinding, and the operator-deployed ClusterRole it binds.
141- pub fn rbac_resource_names ( & self ) -> role_utils:: ResourceNames {
141+ pub fn cluster_resource_names ( & self ) -> role_utils:: ResourceNames {
142142 role_utils:: ResourceNames {
143143 cluster_name : self . name . clone ( ) ,
144144 product_name : product_name ( ) ,
145145 }
146146 }
147147
148148 /// Type-safe names for the resources of a given role group.
149- pub ( crate ) fn resource_names (
149+ pub ( crate ) fn role_group_resource_names (
150150 & self ,
151151 hbase_role : & HbaseRole ,
152152 role_group_name : & RoleGroupName ,
@@ -323,3 +323,20 @@ pub type HbaseRoleGroupConfig = stackable_operator::v2::role_utils::RoleGroupCon
323323 stackable_operator:: v2:: role_utils:: JavaCommonConfig ,
324324 v1alpha1:: HbaseConfigOverrides ,
325325> ;
326+
327+ #[ cfg( test) ]
328+ mod tests {
329+ use strum:: IntoEnumIterator ;
330+
331+ use super :: ValidatedCluster ;
332+ use crate :: crd:: HbaseRole ;
333+
334+ /// Locks the invariant behind the `expect` in [`ValidatedCluster::role_name`]: every
335+ /// `HbaseRole` variant (present and future) must serialise to a valid `RoleName`.
336+ #[ test]
337+ fn every_hbase_role_serialises_to_a_valid_role_name ( ) {
338+ for role in HbaseRole :: iter ( ) {
339+ ValidatedCluster :: role_name ( & role) ;
340+ }
341+ }
342+ }
0 commit comments