@@ -860,14 +860,26 @@ func TestStackUpdateFromResources(t *testing.T) {
860860
861861 runTest ("ingress isn't considered updated if the generation is different" , func (t * testing.T , container * StackContainer ) {
862862 container .Stack .Generation = 11
863- container .ingressSpec = & zv1.StackSetIngressSpec {}
863+ container .ingressSpec = & zv1.StackSetIngressSpec {
864+ Hosts : []string {"foo.example.org" },
865+ }
864866 container .Resources .Deployment = deployment (11 , 5 , 5 )
865867 container .Resources .Service = service (11 )
866868 container .Resources .Ingress = ingress (10 )
867869 container .Resources .IngressSegment = ingress (11 )
868870 container .updateFromResources ()
869871 require .EqualValues (t , false , container .resourcesUpdated )
870872 })
873+ runTest ("ingress is considered updated if no hostname matches cluster domain" , func (t * testing.T , container * StackContainer ) {
874+ container .Stack .Generation = 11
875+ container .ingressSpec = & zv1.StackSetIngressSpec {}
876+ container .Resources .Deployment = deployment (11 , 5 , 5 )
877+ container .Resources .Service = service (11 )
878+ container .Resources .Ingress = nil
879+ container .Resources .IngressSegment = ingress (11 )
880+ container .updateFromResources ()
881+ require .EqualValues (t , true , container .resourcesUpdated )
882+ })
871883 runTest ("ingress isn't considered updated if it should be gone" , func (t * testing.T , container * StackContainer ) {
872884 container .Stack .Generation = 11
873885 container .Resources .Deployment = deployment (11 , 5 , 5 )
@@ -896,14 +908,26 @@ func TestStackUpdateFromResources(t *testing.T) {
896908 })
897909 runTest ("routegroup isn't considered updated if the generation is different" , func (t * testing.T , container * StackContainer ) {
898910 container .Stack .Generation = 11
899- container .routeGroupSpec = & zv1.RouteGroupSpec {}
911+ container .routeGroupSpec = & zv1.RouteGroupSpec {
912+ Hosts : []string {"foo.example.org" },
913+ }
900914 container .Resources .Deployment = deployment (11 , 5 , 5 )
901915 container .Resources .Service = service (11 )
902916 container .Resources .RouteGroup = routegroup (10 )
903917 container .Resources .RouteGroupSegment = routegroup (11 )
904918 container .updateFromResources ()
905919 require .EqualValues (t , false , container .resourcesUpdated )
906920 })
921+ runTest ("routegroup is considered updated if no hostname matches cluster domain" , func (t * testing.T , container * StackContainer ) {
922+ container .Stack .Generation = 11
923+ container .routeGroupSpec = & zv1.RouteGroupSpec {}
924+ container .Resources .Deployment = deployment (11 , 5 , 5 )
925+ container .Resources .Service = service (11 )
926+ container .Resources .RouteGroup = nil
927+ container .Resources .RouteGroupSegment = routegroup (11 )
928+ container .updateFromResources ()
929+ require .EqualValues (t , true , container .resourcesUpdated )
930+ })
907931 runTest ("routegroup isn't considered updated if it should be gone" , func (t * testing.T , container * StackContainer ) {
908932 container .Stack .Generation = 11
909933 container .Resources .Deployment = deployment (11 , 5 , 5 )
0 commit comments