@@ -952,14 +952,14 @@ func TestCreateVirtualService(t *testing.T) {
952
952
}, {
953
953
name : "found predictor and explainer status with path template" ,
954
954
ingressConfig : & v1beta1.IngressConfig {
955
- IngressGateway : constants .KnativeIngressGateway ,
956
- IngressServiceName : "someIngressServiceName" ,
957
- LocalGateway : constants .KnativeLocalGateway ,
958
- LocalGatewayServiceName : "knative-local-gateway.istio-system.svc.cluster.local" ,
959
- UrlScheme : "http" ,
960
- IngressDomain : "my-domain.com" ,
961
- PathTemplate : "/serving/{{ .Namespace }}/{{ .Name }}" ,
962
- DisableIstioVirtualHost : false ,
955
+ IngressGateway : constants .KnativeIngressGateway ,
956
+ KnativeLocalGatewayService : knativeLocalGatewayService ,
957
+ LocalGateway : constants .KnativeLocalGateway ,
958
+ LocalGatewayServiceName : knativeLocalGatewayService ,
959
+ UrlScheme : "http" ,
960
+ IngressDomain : "my-domain.com" ,
961
+ PathTemplate : "/serving/{{ .Namespace }}/{{ .Name }}" ,
962
+ DisableIstioVirtualHost : false ,
963
963
},
964
964
useDefault : false ,
965
965
componentStatus : & v1beta1.InferenceServiceStatus {
@@ -1038,14 +1038,16 @@ func TestCreateVirtualService(t *testing.T) {
1038
1038
},
1039
1039
},
1040
1040
Route : []* istiov1beta1.HTTPRouteDestination {
1041
- {
1042
- Destination : & istiov1beta1.Destination {Host : constants .LocalGatewayHost , Port : & istiov1beta1.PortSelector {Number : constants .CommonDefaultHttpPort }},
1043
- Weight : 100 ,
1041
+ {Destination : & istiov1beta1.Destination {Host : knativeLocalGatewayService , Port : & istiov1beta1.PortSelector {Number : constants .CommonDefaultHttpPort }},
1042
+ Weight : 100 ,
1044
1043
},
1045
1044
},
1046
1045
Headers : & istiov1beta1.Headers {
1047
1046
Request : & istiov1beta1.Headers_HeaderOperations {Set : map [string ]string {
1048
- "Host" : network .GetServiceHostname (constants .ExplainerServiceName (serviceName ), namespace )},
1047
+ "Host" : network .GetServiceHostname (constants .ExplainerServiceName (serviceName ), namespace ),
1048
+ constants .IsvcNameHeader : serviceName ,
1049
+ constants .IsvcNamespaceHeader : namespace ,
1050
+ },
1049
1051
},
1050
1052
},
1051
1053
},
@@ -1069,14 +1071,15 @@ func TestCreateVirtualService(t *testing.T) {
1069
1071
},
1070
1072
},
1071
1073
Route : []* istiov1beta1.HTTPRouteDestination {
1072
- {
1073
- Destination : & istiov1beta1.Destination {Host : constants .LocalGatewayHost , Port : & istiov1beta1.PortSelector {Number : constants .CommonDefaultHttpPort }},
1074
- Weight : 100 ,
1074
+ {Destination : & istiov1beta1.Destination {Host : knativeLocalGatewayService , Port : & istiov1beta1.PortSelector {Number : constants .CommonDefaultHttpPort }},
1075
+ Weight : 100 ,
1075
1076
},
1076
1077
},
1077
1078
Headers : & istiov1beta1.Headers {
1078
1079
Request : & istiov1beta1.Headers_HeaderOperations {Set : map [string ]string {
1079
- "Host" : network .GetServiceHostname (constants .PredictorServiceName (serviceName ), namespace )}},
1080
+ "Host" : network .GetServiceHostname (constants .PredictorServiceName (serviceName ), namespace ),
1081
+ constants .IsvcNameHeader : serviceName ,
1082
+ constants .IsvcNamespaceHeader : namespace }},
1080
1083
},
1081
1084
},
1082
1085
{
@@ -1102,12 +1105,14 @@ func TestCreateVirtualService(t *testing.T) {
1102
1105
},
1103
1106
},
1104
1107
Route : []* istiov1beta1.HTTPRouteDestination {
1105
- createHTTPRouteDestination ("knative-local-gateway.istio-system.svc.cluster.local" ),
1108
+ createHTTPRouteDestination (knativeLocalGatewayService ),
1106
1109
},
1107
1110
Headers : & istiov1beta1.Headers {
1108
1111
Request : & istiov1beta1.Headers_HeaderOperations {
1109
1112
Set : map [string ]string {
1110
- "Host" : network .GetServiceHostname (constants .ExplainerServiceName (serviceName ), namespace ),
1113
+ "Host" : network .GetServiceHostname (constants .ExplainerServiceName (serviceName ), namespace ),
1114
+ constants .IsvcNameHeader : serviceName ,
1115
+ constants .IsvcNamespaceHeader : namespace ,
1111
1116
},
1112
1117
},
1113
1118
},
@@ -1145,12 +1150,14 @@ func TestCreateVirtualService(t *testing.T) {
1145
1150
Uri : "/" ,
1146
1151
},
1147
1152
Route : []* istiov1beta1.HTTPRouteDestination {
1148
- createHTTPRouteDestination ("knative-local-gateway.istio-system.svc.cluster.local" ),
1153
+ createHTTPRouteDestination (knativeLocalGatewayService ),
1149
1154
},
1150
1155
Headers : & istiov1beta1.Headers {
1151
1156
Request : & istiov1beta1.Headers_HeaderOperations {
1152
1157
Set : map [string ]string {
1153
- "Host" : network .GetServiceHostname (constants .PredictorServiceName (serviceName ), namespace ),
1158
+ "Host" : network .GetServiceHostname (constants .PredictorServiceName (serviceName ), namespace ),
1159
+ constants .IsvcNameHeader : serviceName ,
1160
+ constants .IsvcNamespaceHeader : namespace ,
1154
1161
},
1155
1162
},
1156
1163
},
0 commit comments