1- //go:build integ
2- // +build integ
1+ //go:build integ || all
2+ // +build integ all
33
44/*
55 * Copyright The Kmesh Authors.
@@ -24,9 +24,11 @@ import (
2424 "time"
2525
2626 "istio.io/api/label"
27- "istio.io/istio/pkg/config/protocol"
2827 "istio.io/istio/pkg/test/framework"
2928 "istio.io/istio/pkg/test/framework/components/echo"
29+ "istio.io/istio/pkg/test/framework/components/echo/common/ports"
30+ "istio.io/istio/pkg/test/framework/components/echo/deployment"
31+ "istio.io/istio/pkg/test/framework/components/echo/match"
3032 "istio.io/istio/pkg/test/framework/components/namespace"
3133 "istio.io/istio/pkg/test/framework/resource"
3234)
@@ -38,10 +40,14 @@ var (
3840type EchoDeployments struct {
3941 Namespace namespace.Instance
4042 All echo.Instances
43+
44+ // The echo service which is enrolled to Kmesh without waypoint.
45+ EnrolledToKmesh echo.Instances
4146}
4247
4348const (
4449 ServiceName = "echo-service"
50+ ServiceName2 = "echo-service2"
4551 EnrolledToKmesh = "enrolled-to-kmesh"
4652 Timeout = 2 * time .Minute
4753 KmeshReleaseName = "kmesh"
@@ -76,16 +82,12 @@ func SetupApps(t resource.Context, apps *EchoDeployments) error {
7682 return err
7783 }
7884
79- builder := echo .New (t ).
85+ builder := deployment .New (t ).
8086 WithClusters (t .Clusters ()... ).
8187 WithConfig (echo.Config {
82- Service : ServiceName ,
83- Namespace : apps .Namespace ,
84- Ports : echo.Ports {{
85- Name : "http" ,
86- Protocol : protocol .HTTP ,
87- Port : 8080 ,
88- }},
88+ Service : ServiceName ,
89+ Namespace : apps .Namespace ,
90+ Ports : ports .All (),
8991 ServiceAccount : true ,
9092 Subsets : []echo.SubsetConfig {
9193 {
@@ -105,6 +107,30 @@ func SetupApps(t resource.Context, apps *EchoDeployments) error {
105107 },
106108 },
107109 },
110+ }).
111+ WithConfig (echo.Config {
112+ Service : ServiceName2 ,
113+ Namespace : apps .Namespace ,
114+ Ports : ports .All (),
115+ ServiceAccount : true ,
116+ Subsets : []echo.SubsetConfig {
117+ {
118+ Replicas : 1 ,
119+ Version : "v1" ,
120+ Labels : map [string ]string {
121+ "app" : ServiceName2 ,
122+ "version" : "v1" ,
123+ },
124+ },
125+ {
126+ Replicas : 1 ,
127+ Version : "v2" ,
128+ Labels : map [string ]string {
129+ "app" : ServiceName2 ,
130+ "version" : "v2" ,
131+ },
132+ },
133+ },
108134 })
109135
110136 echos , err := builder .Build ()
@@ -113,5 +139,7 @@ func SetupApps(t resource.Context, apps *EchoDeployments) error {
113139 }
114140
115141 apps .All = echos
142+
143+ apps .EnrolledToKmesh = match .ServiceName (echo.NamespacedName {Name : ServiceName2 , Namespace : apps .Namespace }).GetMatches (echos )
116144 return nil
117145}
0 commit comments