File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
crates/stackable-operator/src/utils Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -213,12 +213,21 @@ mod tests {
213
213
}
214
214
215
215
#[ test]
216
- fn use_different_kubernetes_service_dns_domain_value ( ) {
217
- let service_dns_domain = "my-cluster.local" . to_string ( ) ;
216
+ fn use_different_kubernetes_cluster_domain_value ( ) {
217
+ let cluster_domain = "my-cluster.local" . to_string ( ) ;
218
+
219
+ // set different domain via env var
218
220
unsafe {
219
- env:: set_var ( KUBERNETES_CLUSTER_DOMAIN_ENV , & service_dns_domain ) ;
221
+ env:: set_var ( KUBERNETES_CLUSTER_DOMAIN_ENV , & cluster_domain ) ;
220
222
}
221
- //assert_eq!(KUBERNETES_CLUSTER_DOMAIN.get().expect(""), service_dns_domain.try_into().unwrap());
223
+
224
+ // initialize the lock
225
+ let _ = KUBERNETES_CLUSTER_DOMAIN . set ( resolve_kubernetes_cluster_domain ( ) . unwrap ( ) ) ;
226
+
227
+ assert_eq ! (
228
+ cluster_domain,
229
+ KUBERNETES_CLUSTER_DOMAIN . get( ) . unwrap( ) . to_string( )
230
+ ) ;
222
231
}
223
232
224
233
#[ test]
@@ -233,8 +242,8 @@ mod tests {
233
242
let lines = read_file_from_string ( resolv_conf) ;
234
243
let last_search_entry = find_last_search_entry ( lines. as_slice ( ) ) . unwrap ( ) ;
235
244
let search_entry = trim_search_line ( & last_search_entry) . unwrap ( ) ;
236
- let service_dns_domain = find_shortest_entry ( search_entry) . unwrap ( ) ;
237
- // assert_eq!(service_dns_domain, KUBERNETES_SERVICE_DNS_DOMAIN_DEFAULT );
245
+ let cluster_domain = find_shortest_entry ( search_entry) . unwrap ( ) ;
246
+ assert_eq ! ( cluster_domain , KUBERNETES_CLUSTER_DOMAIN_DEFAULT ) ;
238
247
}
239
248
}
240
249
You can’t perform that action at this time.
0 commit comments