Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Fix #77

Merged
merged 4 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 15 additions & 3 deletions smi-conformance/grpc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo

config = linkerdConfig
switch req.Mesh.Type {
case smp.ServiceMesh_APP_MESH:
case smp.ServiceMesh_LINKERD:
config = linkerdConfig
req.Mesh.Annotations["linkerd.io/inject"] = "enabled"
case smp.ServiceMesh_APP_MESH:
config = linkerdConfig
req.Mesh.Labels["appmesh.k8s.aws/sidecarInjectorWebhook"] = "enabled"
case smp.ServiceMesh_MAESH:
config = maeshConfig
case smp.ServiceMesh_ISTIO:
Expand All @@ -53,6 +56,10 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo
case smp.ServiceMesh_OPEN_SERVICE_MESH:
config = osmConfig
req.Mesh.Labels["openservicemesh.io/monitored-by"] = "osm"
case smp.ServiceMesh_KUMA:
req.Mesh.Annotations["kuma.io/sidecar-injection"] = "enabled"
case smp.ServiceMesh_NGINX_SERVICE_MESH:
req.Mesh.Annotations["njector.nsm.nginx.com/auto-inject"] = "true"

}

Expand All @@ -64,12 +71,17 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo
"traffic-split": 11,
"traffic-spec": 6,
}
specVersion := map[string]string{
"traffic-access": "v0.6.0/v1alpha3",
"traffic-split": "v0.6.0/v1alpha4",
"traffic-spec": "v0.6.0/v1alpha4",
}

details := make([]*conformance.Detail, 0)
for _, res := range result.Testsuite[0].Testcase {
d := &conformance.Detail{
Smispec: res.Name,
Specversion: "v1alpha1",
Specversion: specVersion[res.Name],
Assertion: strconv.Itoa(stepsCount[res.Name]),
Duration: res.Time,
Capability: conformance.Capability_FULL,
Expand Down Expand Up @@ -98,7 +110,7 @@ func (s *Service) RunTest(ctx context.Context, req *conformance.Request) (*confo

// A hacky way to see the testStep Failed, since KUDO only provides it in Failure.Message
re := regexp.MustCompile(`[0-9]+`)
if res.Failure != nil {
if res.Failure.Message != "" {
dhruv0000 marked this conversation as resolved.
Show resolved Hide resolved
stepFailed := re.FindAllString(res.Failure.Message, 1)
if len(stepFailed) != 0 {
passed, _ := strconv.Atoi(stepFailed[0])
Expand Down
31 changes: 18 additions & 13 deletions smi-conformance/test-gen/test-yamls/traffic-access/04-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
apiVersion: specs.smi-spec.io/v1alpha1
---
apiVersion: specs.smi-spec.io/v1alpha4
kind: TCPRoute
metadata:
name: service-tcp-route
namespace: <NAMESPACE>
spec:
matches:
ports: []
---
apiVersion: access.smi-spec.io/v1alpha1
apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
metadata:
name: service-targets
namespace: <NAMESPACE>
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
specs:
- kind: TCPRoute
name: service-tcp-route
spec:
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
rules:
- kind: TCPRoute
name: service-tcp-route
30 changes: 17 additions & 13 deletions smi-conformance/test-gen/test-yamls/traffic-access/04-install.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
---
apiVersion: specs.smi-spec.io/v1alpha1
apiVersion: specs.smi-spec.io/v1alpha4
kind: TCPRoute
metadata:
name: service-tcp-route
namespace: <NAMESPACE>
spec:
matches:
ports: []
---
apiVersion: access.smi-spec.io/v1alpha1
apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
metadata:
name: service-targets
namespace: <NAMESPACE>
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
specs:
- kind: TCPRoute
name: service-tcp-route
spec:
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
rules:
- kind: TCPRoute
name: service-tcp-route
30 changes: 17 additions & 13 deletions smi-conformance/test-gen/test-yamls/traffic-access/06-errors.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
---
apiVersion: specs.smi-spec.io/v1alpha1
apiVersion: specs.smi-spec.io/v1alpha4
kind: TCPRoute
metadata:
name: service-tcp-route
namespace: <NAMESPACE>
spec:
matches:
ports: []
---
apiVersion: access.smi-spec.io/v1alpha1
apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
metadata:
name: service-targets
namespace: <NAMESPACE>
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
specs:
- kind: TCPRoute
name: service-tcp-route
spec:
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
rules:
- kind: TCPRoute
name: service-tcp-route
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: kudo.dev/v1alpha1
kind: TestStep
delete:
- apiVersion: specs.smi-spec.io/v1alpha1
- apiVersion: specs.smi-spec.io/v1alpha4
kind: TCPRoute
namespace: <NAMESPACE>
name: service-tcp-route
- apiVersion: access.smi-spec.io/v1alpha1
- apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
namespace: <NAMESPACE>
name: service-targets
33 changes: 17 additions & 16 deletions smi-conformance/test-gen/test-yamls/traffic-spec/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: specs.smi-spec.io/v1alpha1
apiVersion: specs.smi-spec.io/v1alpha4
kind: HTTPRouteGroup
metadata:
name: http-rg
Expand All @@ -8,22 +8,23 @@ matches:
pathRegex: /metrics
methods: ["*"]
---
apiVersion: access.smi-spec.io/v1alpha1
apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
metadata:
name: service-targets
namespace: <NAMESPACE>
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
specs:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch
spec:
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
rules:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch
33 changes: 17 additions & 16 deletions smi-conformance/test-gen/test-yamls/traffic-spec/03-install.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: specs.smi-spec.io/v1alpha1
apiVersion: specs.smi-spec.io/v1alpha4
kind: HTTPRouteGroup
metadata:
name: http-rg
Expand All @@ -8,22 +8,23 @@ matches:
pathRegex: /metrics
methods: ["*"]
---
apiVersion: access.smi-spec.io/v1alpha1
apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
metadata:
name: service-targets
namespace: <NAMESPACE>
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
specs:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch
spec:
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
rules:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch
44 changes: 23 additions & 21 deletions smi-conformance/test-gen/test-yamls/traffic-spec/05-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
apiVersion: specs.smi-spec.io/v1alpha1
apiVersion: specs.smi-spec.io/v1alpha4
kind: HTTPRouteGroup
metadata:
name: http-rg
namespace: <NAMESPACE>
matches:
- name: testMatch
pathRegex: ".*"
methods:
- GET
spec:
matches:
- name: testMatch
pathRegex: ".*"
methods:
- GET
---
apiVersion: access.smi-spec.io/v1alpha1
apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
metadata:
name: service-targets
namespace: <NAMESPACE>
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
specs:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch
spec:
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
rules:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch
44 changes: 23 additions & 21 deletions smi-conformance/test-gen/test-yamls/traffic-spec/05-install.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
apiVersion: specs.smi-spec.io/v1alpha1
apiVersion: specs.smi-spec.io/v1alpha4
kind: HTTPRouteGroup
metadata:
name: http-rg
namespace: <NAMESPACE>
matches:
- name: testMatch
pathRegex: ".*"
methods:
- GET
spec:
matches:
- name: testMatch
pathRegex: ".*"
methods:
- GET
---
apiVersion: access.smi-spec.io/v1alpha1
apiVersion: access.smi-spec.io/v1alpha3
kind: TrafficTarget
metadata:
name: service-targets
namespace: <NAMESPACE>
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
specs:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch
spec:
destination:
kind: ServiceAccount
name: service-b
namespace: <NAMESPACE>
port: "9091"
sources:
- kind: ServiceAccount
name: service-a
namespace: <NAMESPACE>
rules:
- kind: HTTPRouteGroup
name: http-rg
matches:
- testMatch