Skip to content

Commit

Permalink
fix merge conflict (opendatahub-io#376)
Browse files Browse the repository at this point in the history
Signed-off-by: jooho lee <[email protected]>
  • Loading branch information
israel-hdez authored and Jooho committed Jun 13, 2024
1 parent 4b1130a commit bb98d24
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 @@ -315,6 +315,7 @@ var _ = Describe("v1beta1 inference service controller", func() {
Spec: istiov1beta1.VirtualService{
Gateways: []string{
constants.KnativeLocalGateway,
constants.IstioMeshGateway,
constants.KnativeIngressGateway,
},
Hosts: []string{
Expand All @@ -325,7 +326,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 @@ -55,7 +55,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 @@ -129,7 +129,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 @@ -184,7 +184,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 @@ -194,7 +194,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 @@ -292,7 +292,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 @@ -364,7 +364,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 @@ -463,7 +463,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 @@ -478,7 +478,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 @@ -564,7 +564,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 @@ -574,7 +574,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 @@ -679,7 +679,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 @@ -750,7 +750,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 @@ -948,7 +948,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 @@ -958,7 +958,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 bb98d24

Please sign in to comment.