Skip to content

Commit ad4da7f

Browse files
committed
fix: only append dot if default clusterdomain is used
1 parent 2a29dc3 commit ad4da7f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

crates/stackable-operator/src/utils/cluster_info.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ impl KubernetesClusterInfo {
2424
pub fn new(cluster_info_opts: &KubernetesClusterInfoOpts) -> Self {
2525
let cluster_domain = match &cluster_info_opts.kubernetes_cluster_domain {
2626
Some(cluster_domain) => {
27-
// Append trailing dot to make the domain name a FQDN to improve DNS lookup performance, see https://github.com/stackabletech/issues/issues/656
28-
let cluster_domain = DomainName::from_str(&format!("{}.", cluster_domain))
29-
.expect("cluster_domain should already have been validated");
3027
tracing::info!(%cluster_domain, "Using configured Kubernetes cluster domain");
3128

32-
cluster_domain
29+
cluster_domain.clone()
3330
}
3431
None => {
3532
// TODO(sbernauer): Do some sort of advanced auto-detection, see https://github.com/stackabletech/issues/issues/436.
@@ -55,7 +52,8 @@ mod test {
5552

5653
#[rstest]
5754
#[case(None, KUBERNETES_CLUSTER_DOMAIN_DEFAULT)]
58-
#[case(Some("example.com".parse().unwrap()), "example.com.")]
55+
#[case(Some("example.com".parse().unwrap()), "example.com")]
56+
#[case(Some("example.com.".parse().unwrap()), "example.com.")]
5957
fn test_kubernetes_cluster_info_creation(
6058
#[case] kubernetes_cluster_domain: Option<DomainName>,
6159
#[case] expected_cluster_domain: &str,

0 commit comments

Comments
 (0)