Skip to content

Commit

Permalink
Merge pull request #77 from dhruv0000/manifestUpdate
Browse files Browse the repository at this point in the history
Build Fix
  • Loading branch information
kumarabd committed Mar 22, 2021
2 parents 06b4f88 + d11b0fa commit 388476e
Show file tree
Hide file tree
Showing 18 changed files with 158 additions and 127 deletions.
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 != "" {
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
Loading

0 comments on commit 388476e

Please sign in to comment.