@@ -2,6 +2,7 @@ package core
22
33import (
44 "errors"
5+ "fmt"
56 "reflect"
67 "slices"
78 "strconv"
5455 }
5556)
5657
58+ const (
59+ perStackDomain = "ingress.cluster.local"
60+ )
61+
5762func TestGetServicePorts (tt * testing.T ) {
5863 backendPort := intstr .FromInt (int (8080 ))
5964 backendPort2 := intstr .FromInt (int (8081 ))
@@ -307,7 +312,9 @@ func TestStackGenerateIngress(t *testing.T) {
307312 stackGenerationAnnotationKey : "11" ,
308313 "ingress" : "annotation" ,
309314 },
310- expectedHosts : []string {"foo-v1.example.org" },
315+ expectedHosts : []string {
316+ fmt .Sprintf ("foo-v1.%s" , perStackDomain ),
317+ },
311318 },
312319 } {
313320 t .Run (tc .name , func (t * testing.T ) {
@@ -320,7 +327,8 @@ func TestStackGenerateIngress(t *testing.T) {
320327 stacksetName : "foo" ,
321328 ingressSpec : tc .ingressSpec ,
322329 backendPort : & intStrBackendPort ,
323- perStackDomain : "example.org" ,
330+ clusterDomains : []string {"example.org" },
331+ perStackDomain : perStackDomain ,
324332 }
325333 ingress , err := c .GenerateIngress ()
326334
@@ -618,7 +626,9 @@ func TestStackGenerateRouteGroup(t *testing.T) {
618626 stackGenerationAnnotationKey : "11" ,
619627 "routegroup" : "annotation" ,
620628 },
621- expectedHosts : []string {"foo-v1.example.org" },
629+ expectedHosts : []string {
630+ fmt .Sprintf ("foo-v1.%s" , perStackDomain ),
631+ },
622632 },
623633 {
624634 name : "custom load balancer" ,
@@ -635,7 +645,9 @@ func TestStackGenerateRouteGroup(t *testing.T) {
635645 expectedAnnotations : map [string ]string {
636646 stackGenerationAnnotationKey : "11" ,
637647 },
638- expectedHosts : []string {"foo-v1.example.org" },
648+ expectedHosts : []string {
649+ fmt .Sprintf ("foo-v1.%s" , perStackDomain ),
650+ },
639651 },
640652 } {
641653 t .Run (tc .name , func (t * testing.T ) {
@@ -648,7 +660,8 @@ func TestStackGenerateRouteGroup(t *testing.T) {
648660 stacksetName : "foo" ,
649661 routeGroupSpec : tc .routeGroupSpec ,
650662 backendPort : & intStrBackendPort ,
651- perStackDomain : "example.org" ,
663+ clusterDomains : []string {"example.org" },
664+ perStackDomain : perStackDomain ,
652665 }
653666 rg , err := c .GenerateRouteGroup ()
654667 if tc .expectError {
0 commit comments