File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
crates/stackable-operator/src/utils Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -46,3 +46,30 @@ impl KubernetesClusterInfo {
4646 Self { cluster_domain }
4747 }
4848}
49+
50+
51+ #[ cfg( test) ]
52+ mod test {
53+ use rstest:: rstest;
54+
55+ use super :: * ;
56+
57+ #[ rstest]
58+ #[ case( None , KUBERNETES_CLUSTER_DOMAIN_DEFAULT ) ]
59+ #[ case( Some ( "example.com" . parse( ) . unwrap( ) ) , "example.com." ) ]
60+ fn test_kubernetes_cluster_info_creation (
61+ #[ case] kubernetes_cluster_domain : Option < DomainName > ,
62+ #[ case] expected_cluster_domain : & str ,
63+ ) {
64+ let opts = KubernetesClusterInfoOpts {
65+ kubernetes_cluster_domain,
66+ } ;
67+
68+ let cluster_info = KubernetesClusterInfo :: new ( & opts) ;
69+
70+ assert_eq ! (
71+ cluster_info. cluster_domain,
72+ DomainName :: from_str( expected_cluster_domain) . unwrap( )
73+ ) ;
74+ }
75+ }
You can’t perform that action at this time.
0 commit comments