Skip to content

Commit d769c21

Browse files
committed
Capture in variable
1 parent 9ff2b41 commit d769c21

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/crd/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,13 +721,13 @@ impl DruidCluster {
721721

722722
/// The fully-qualified domain name of the role-level load-balanced Kubernetes `Service`
723723
pub fn role_service_fqdn(&self, role: &DruidRole) -> Option<String> {
724+
let cluster_domain = KUBERNETES_CLUSTER_DOMAIN
725+
.get()
726+
.expect("KUBERNETES_CLUSTER_DOMAIN must first be set by calling initialize_operator");
724727
Some(format!(
725-
"{}.{}.svc.{}",
728+
"{}.{}.svc.{cluster_domain}",
726729
self.role_service_name(role)?,
727730
self.metadata.namespace.as_ref()?,
728-
KUBERNETES_CLUSTER_DOMAIN.get().expect(
729-
"KUBERNETES_CLUSTER_DOMAIN must first be set by calling initialize_operator"
730-
),
731731
))
732732
}
733733

0 commit comments

Comments
 (0)