Skip to content

Commit 04bec6d

Browse files
committed
Add labels for istio
Signed-off-by: Naveen Jain <nveenjain@gmail.com>
1 parent 44993b6 commit 04bec6d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

smi-conformance/grpc/handlers.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,30 @@ var (
2121
PortSvcB: "9091",
2222
PortSvcC: "9091",
2323
}
24+
istioConfig = &test_gen.Linkerd{
25+
PortSvcA: "9091",
26+
PortSvcB: "9091",
27+
PortSvcC: "9091",
28+
}
2429
)
2530

2631
func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*conformance.Response, error) {
2732
results := make([]*conformance.SingleTestResult, 0)
2833
var config test_gen.ServiceMesh
2934

35+
config = linkerdConfig
36+
labels := make(map[string]string)
3037
switch req.Meshname {
3138
case "linkerd":
3239
config = linkerdConfig
40+
req.Annotations["linkerd.io/inject"] = "enabled"
3341
case "maesh":
3442
config = maeshConfig
43+
case "istio":
44+
labels["istio-injection"] = "enabled"
3545
}
3646

37-
result := test_gen.RunTest(config, req.Annotations)
47+
result := test_gen.RunTest(config, req.Annotations, labels)
3848
fmt.Printf("%+v\n", result)
3949
for _, res := range result.Testcase {
4050
results = append(results, &conformance.SingleTestResult{

smi-conformance/test-gen/test_gen.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Results struct {
2828
} `json:"testcase"`
2929
}
3030

31-
func RunTest(meshConfig ServiceMesh, annotations map[string]string) Results {
31+
func RunTest(meshConfig ServiceMesh, annotations, labels map[string]string) Results {
3232
manifestDirs := []string{}
3333
output := Results{}
3434
results := &report.Testsuites{}
@@ -77,6 +77,7 @@ func RunTest(meshConfig ServiceMesh, annotations map[string]string) Results {
7777
T: t,
7878
SuiteCustomTests: testHandlers,
7979
NamespaceAnnotations: annotations,
80+
NamespaceLabels: labels,
8081
}
8182

8283
// Runs the test using the inCluster kubeConfig (runs only when the code is running inside the pod)

0 commit comments

Comments
 (0)