@@ -860,14 +860,26 @@ func TestStackUpdateFromResources(t *testing.T) {
860
860
861
861
runTest ("ingress isn't considered updated if the generation is different" , func (t * testing.T , container * StackContainer ) {
862
862
container .Stack .Generation = 11
863
- container .ingressSpec = & zv1.StackSetIngressSpec {}
863
+ container .ingressSpec = & zv1.StackSetIngressSpec {
864
+ Hosts : []string {"foo.example.org" },
865
+ }
864
866
container .Resources .Deployment = deployment (11 , 5 , 5 )
865
867
container .Resources .Service = service (11 )
866
868
container .Resources .Ingress = ingress (10 )
867
869
container .Resources .IngressSegment = ingress (11 )
868
870
container .updateFromResources ()
869
871
require .EqualValues (t , false , container .resourcesUpdated )
870
872
})
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
+ })
871
883
runTest ("ingress isn't considered updated if it should be gone" , func (t * testing.T , container * StackContainer ) {
872
884
container .Stack .Generation = 11
873
885
container .Resources .Deployment = deployment (11 , 5 , 5 )
@@ -896,14 +908,26 @@ func TestStackUpdateFromResources(t *testing.T) {
896
908
})
897
909
runTest ("routegroup isn't considered updated if the generation is different" , func (t * testing.T , container * StackContainer ) {
898
910
container .Stack .Generation = 11
899
- container .routeGroupSpec = & zv1.RouteGroupSpec {}
911
+ container .routeGroupSpec = & zv1.RouteGroupSpec {
912
+ Hosts : []string {"foo.example.org" },
913
+ }
900
914
container .Resources .Deployment = deployment (11 , 5 , 5 )
901
915
container .Resources .Service = service (11 )
902
916
container .Resources .RouteGroup = routegroup (10 )
903
917
container .Resources .RouteGroupSegment = routegroup (11 )
904
918
container .updateFromResources ()
905
919
require .EqualValues (t , false , container .resourcesUpdated )
906
920
})
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
+ })
907
931
runTest ("routegroup isn't considered updated if it should be gone" , func (t * testing.T , container * StackContainer ) {
908
932
container .Stack .Generation = 11
909
933
container .Resources .Deployment = deployment (11 , 5 , 5 )
0 commit comments