Skip to content

Commit

Permalink
Merge pull request #370 from Jooho/cherrypick-369
Browse files Browse the repository at this point in the history
cherry-pick(#369) and fix conflict
  • Loading branch information
openshift-merge-bot[bot] authored Jun 13, 2024
2 parents af908a7 + 49df3c2 commit 9148a63
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ const (

var (
LocalGatewayHost = "knative-local-gateway.istio-system.svc." + network.GetClusterDomainName()
IstioMeshGateway = "mesh"
)

// InferenceService Component enums
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/v1beta1/inferenceservice/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ var _ = Describe("v1beta1 inference service controller", func() {
Spec: istiov1beta1.VirtualService{
Gateways: []string{
constants.KnativeLocalGateway,
constants.IstioMeshGateway,
constants.KnativeIngressGateway,
},
Hosts: []string{
Expand All @@ -326,7 +327,7 @@ var _ = Describe("v1beta1 inference service controller", func() {
{
Match: []*istiov1beta1.HTTPMatchRequest{
{
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
Authority: &istiov1beta1.StringMatch{
MatchType: &istiov1beta1.StringMatch_Regex{
Regex: constants.HostRegExp(network.GetServiceHostname(serviceKey.Name, serviceKey.Namespace)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func createHTTPMatchRequest(prefix, targetHost, internalHost string, isInternal
Regex: constants.HostRegExp(internalHost),
},
},
Gateways: []string{config.LocalGateway},
Gateways: []string{config.LocalGateway, constants.IstioMeshGateway},
},
}
if !isInternal {
Expand Down Expand Up @@ -373,6 +373,7 @@ func createIngress(isvc *v1beta1.InferenceService, useDefault bool, config *v1be
}
gateways := []string{
config.LocalGateway,
constants.IstioMeshGateway,
}
if !isInternal {
hosts = append(hosts, serviceHost)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestCreateVirtualService(t *testing.T) {
Regex: constants.HostRegExp(network.GetServiceHostname(serviceName, namespace)),
},
},
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
},
{
Authority: &istiov1beta1.StringMatch{
Expand Down Expand Up @@ -128,7 +128,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName, serviceHostName},
Gateways: []string{constants.KnativeLocalGateway, constants.KnativeIngressGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway, constants.KnativeIngressGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: predictorRouteMatch,
Expand Down Expand Up @@ -183,7 +183,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName},
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: []*istiov1beta1.HTTPMatchRequest{
Expand All @@ -193,7 +193,7 @@ func TestCreateVirtualService(t *testing.T) {
Regex: constants.HostRegExp(network.GetServiceHostname(serviceName, namespace)),
},
},
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
},
},
Route: []*istiov1beta1.HTTPRouteDestination{
Expand Down Expand Up @@ -291,7 +291,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName, serviceHostName},
Gateways: []string{constants.KnativeLocalGateway, constants.KnativeIngressGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway, constants.KnativeIngressGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: predictorRouteMatch,
Expand Down Expand Up @@ -363,7 +363,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName, serviceHostName},
Gateways: []string{constants.KnativeLocalGateway, constants.KnativeIngressGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway, constants.KnativeIngressGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: predictorRouteMatch,
Expand Down Expand Up @@ -462,7 +462,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName, serviceHostName},
Gateways: []string{constants.KnativeLocalGateway, constants.KnativeIngressGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway, constants.KnativeIngressGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: []*istiov1beta1.HTTPMatchRequest{
Expand All @@ -477,7 +477,7 @@ func TestCreateVirtualService(t *testing.T) {
Regex: constants.HostRegExp(network.GetServiceHostname(serviceName, namespace)),
},
},
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
},
{
Uri: &istiov1beta1.StringMatch{
Expand Down Expand Up @@ -563,7 +563,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName, serviceHostName, "my-domain.com"},
Gateways: []string{constants.KnativeLocalGateway, constants.KnativeIngressGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway, constants.KnativeIngressGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: []*istiov1beta1.HTTPMatchRequest{
Expand All @@ -573,7 +573,7 @@ func TestCreateVirtualService(t *testing.T) {
Regex: constants.HostRegExp(network.GetServiceHostname(serviceName, namespace)),
},
},
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
},
{
Authority: &istiov1beta1.StringMatch{
Expand Down Expand Up @@ -678,7 +678,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName, serviceHostName},
Gateways: []string{constants.KnativeLocalGateway, constants.KnativeIngressGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway, constants.KnativeIngressGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: predictorRouteMatch,
Expand Down Expand Up @@ -749,7 +749,7 @@ func TestCreateVirtualService(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: serviceName, Namespace: namespace, Annotations: annotations, Labels: labels},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName, serviceHostName},
Gateways: []string{constants.KnativeLocalGateway, constants.KnativeIngressGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway, constants.KnativeIngressGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: predictorRouteMatch,
Expand Down Expand Up @@ -947,7 +947,7 @@ func TestCreateVirtualService(t *testing.T) {
}},
Spec: istiov1beta1.VirtualService{
Hosts: []string{serviceInternalHostName},
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
Http: []*istiov1beta1.HTTPRoute{
{
Match: []*istiov1beta1.HTTPMatchRequest{
Expand All @@ -957,7 +957,7 @@ func TestCreateVirtualService(t *testing.T) {
Regex: constants.HostRegExp(network.GetServiceHostname(serviceName, namespace)),
},
},
Gateways: []string{constants.KnativeLocalGateway},
Gateways: []string{constants.KnativeLocalGateway, constants.IstioMeshGateway},
},
},
Route: []*istiov1beta1.HTTPRouteDestination{
Expand Down

0 comments on commit 9148a63

Please sign in to comment.