@@ -281,15 +281,15 @@ impl ValidatedCluster {
281281
282282 /// Type-safe names for the per-cluster RBAC resources: the ServiceAccount shared by all
283283 /// Pods, its (namespaced) RoleBinding, and the operator-deployed ClusterRole it binds.
284- pub fn rbac_resource_names ( & self ) -> role_utils:: ResourceNames {
284+ pub fn cluster_resource_names ( & self ) -> role_utils:: ResourceNames {
285285 role_utils:: ResourceNames {
286286 cluster_name : self . name . clone ( ) ,
287287 product_name : product_name ( ) ,
288288 }
289289 }
290290
291291 /// Type-safe names for the resources of the given role's role group.
292- pub ( crate ) fn resource_names (
292+ pub ( crate ) fn role_group_resource_names (
293293 & self ,
294294 role : & DruidRole ,
295295 role_group_name : & RoleGroupName ,
@@ -614,7 +614,7 @@ mod tests {
614614 use strum:: IntoEnumIterator ;
615615
616616 use super :: {
617- Error ,
617+ Error , ValidatedCluster ,
618618 test_support:: { MINIMAL_DRUID_YAML , druid_from_yaml} ,
619619 validate,
620620 } ;
@@ -718,4 +718,13 @@ mod tests {
718718 "expected a ClusterIdentity error when the cluster has no uid"
719719 ) ;
720720 }
721+
722+ /// Locks the invariant behind the `expect` in [`ValidatedCluster::role_name`]: every
723+ /// `DruidRole` variant (present and future) must serialise to a valid `RoleName`.
724+ #[ test]
725+ fn every_druid_role_serialises_to_a_valid_role_name ( ) {
726+ for role in DruidRole :: iter ( ) {
727+ ValidatedCluster :: role_name ( & role) ;
728+ }
729+ }
721730}
0 commit comments