Skip to content

Commit

Permalink
* updated get single resource test data
Browse files Browse the repository at this point in the history
Feature #661
  • Loading branch information
tharun208 committed Apr 15, 2020
1 parent 522f1e8 commit f57aa4f
Show file tree
Hide file tree
Showing 19 changed files with 83 additions and 49 deletions.
4 changes: 2 additions & 2 deletions app/kumactl/cmd/get/get_single_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ var _ = Describe("kumactl get [resource] NAME", func() {
var rootCmd *cobra.Command
var outbuf, errbuf *bytes.Buffer
var store core_store.ResourceStore

now, _ := time.Parse(time.RFC3339, "2018-07-17T16:05:36.995Z")
BeforeEach(func() {
rootCtx = &kumactl_cmd.RootContext{
Runtime: kumactl_cmd.RootRuntime{
Now: time.Now,
Now: func() time.Time { return now },
NewResourceStore: func(*config_proto.ControlPlaneCoordinates_ApiServer) (core_store.ResourceStore, error) {
return store, nil
},
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-dataplane.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"type": "Dataplane",
"mesh": "default",
"name": "dataplane-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"networking": {
"address": "127.0.0.1",
"inbound": [
Expand Down
3 changes: 2 additions & 1 deletion app/kumactl/cmd/get/testdata/get-dataplane.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
creationTime: 2018-07-17T16:05:36.995Z
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: dataplane-1
networking:
address: 127.0.0.1
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-fault-injection.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"type": "FaultInjection",
"mesh": "default",
"name": "fault-injection-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"sources": [
{
"match": {
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-fault-injection.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ conf:
abort:
httpStatus: 500
percentage: 50
creationTime: 2018-07-17T16:05:36.995Z
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: fault-injection-1
sources:
- match:
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-healthcheck.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"type": "HealthCheck",
"mesh": "default",
"name": "healthcheck-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"sources": [
{
"match": {
Expand Down
18 changes: 10 additions & 8 deletions app/kumactl/cmd/get/testdata/get-healthcheck.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
mesh: default
name: healthcheck-1
sources:
- match:
service: web
destinations:
- match:
service: backend
conf:
activeChecks:
interval: 10s
Expand All @@ -15,4 +7,14 @@ conf:
passiveChecks:
unhealthyThreshold: 3
penaltyInterval: 5s
creationTime: 2018-07-17T16:05:36.995Z
destinations:
- match:
service: backend
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: healthcheck-1
sources:
- match:
service: web
type: HealthCheck
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-mesh.golden.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"type": "Mesh",
"name": "mesh-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"mtls": {
"ca": {
"provided": {}
Expand Down
3 changes: 2 additions & 1 deletion app/kumactl/cmd/get/testdata/get-mesh.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
creationTime: 2018-07-17T16:05:36.995Z
logging:
backends:
- name: logstash
Expand All @@ -11,6 +11,7 @@ metrics:
prometheus:
path: /non-standard-path
port: 1234
modificationTime: 2018-07-17T16:05:36.995Z
mtls:
ca:
provided: {}
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-proxytemplate.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"mesh": "default",
"name": "proxytemplate-1",
"type": "ProxyTemplate",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"selectors": [
{
"match": {
Expand Down
8 changes: 5 additions & 3 deletions app/kumactl/cmd/get/testdata/get-proxytemplate.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
conf:
imports:
- default-proxy
creationTime: 2018-07-17T16:05:36.995Z
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: proxytemplate-1
selectors:
- match:
service: "backend"
conf:
imports:
- default-proxy
type: ProxyTemplate
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-traffic-log.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"type": "TrafficLog",
"mesh": "default",
"name": "traffic-log-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"sources": [
{
"match": {
Expand Down
10 changes: 6 additions & 4 deletions app/kumactl/cmd/get/testdata/get-traffic-log.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
mesh: default
name: traffic-log-1
conf:
backend: file
creationTime: 2018-07-17T16:05:36.995Z
destinations:
- match:
env: dev
service: backend1
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: traffic-log-1
sources:
- match:
service: web1
version: "1.0"
conf:
backend: file
type: TrafficLog
38 changes: 20 additions & 18 deletions app/kumactl/cmd/get/testdata/get-traffic-permission.golden.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"type": "TrafficPermission",
"mesh": "default",
"name": "traffic-permission-1",
"sources": [
{
"match": {
"service": "web1",
"version": "1.0"
}
"type": "TrafficPermission",
"mesh": "default",
"name": "traffic-permission-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"sources": [
{
"match": {
"service": "web1",
"version": "1.0"
}
],
"destinations": [
{
"match": {
"env": "dev",
"service": "backend1"
}
}
],
"destinations": [
{
"match": {
"env": "dev",
"service": "backend1"
}
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
mesh: default
name: traffic-permission-1
creationTime: 2018-07-17T16:05:36.995Z
destinations:
- match:
env: dev
service: backend1
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: traffic-permission-1
sources:
- match:
service: web1
Expand Down
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-traffic-route.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"type": "TrafficRoute",
"mesh": "default",
"name": "traffic-route-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"sources": [
{
"match": {
Expand Down
18 changes: 10 additions & 8 deletions app/kumactl/cmd/get/testdata/get-traffic-route.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
mesh: default
name: traffic-route-1
sources:
- match:
service: backend
destinations:
- match:
service: redis
conf:
- weight: 90
destination:
service: redis
version: "1.0"
creationTime: 2018-07-17T16:05:36.995Z
destinations:
- match:
service: redis
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: traffic-route-1
sources:
- match:
service: backend
type: TrafficRoute
2 changes: 2 additions & 0 deletions app/kumactl/cmd/get/testdata/get-traffic-trace.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"type": "TrafficTrace",
"mesh": "default",
"name": "traffic-trace-1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"selectors": [
{
"match": {
Expand Down
6 changes: 4 additions & 2 deletions app/kumactl/cmd/get/testdata/get-traffic-trace.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
conf:
backend: zipkin
creationTime: 2018-07-17T16:05:36.995Z
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: traffic-trace-1
selectors:
- match:
service: web1
version: "1.0"
conf:
backend: zipkin
type: TrafficTrace

0 comments on commit f57aa4f

Please sign in to comment.