Skip to content

Commit

Permalink
feature exposed creationTime & modificationTime for kuma get fault in…
Browse files Browse the repository at this point in the history
…jections

* updated tests
Feature kumahq#661
  • Loading branch information
tharun208 committed Apr 14, 2020
1 parent dd2e5b1 commit cc845a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/kumactl/cmd/get/get_fault_injections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ var _ = Describe("kumactl get fault-injections", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

var t1 time.Time
BeforeEach(func() {
// setup
t1, _ = time.Parse(time.RFC3339, "2018-07-17T16:05:36.995+00:00")
rootCtx = &kumactl_cmd.RootContext{
Runtime: kumactl_cmd.RootRuntime{
Now: time.Now,
Expand All @@ -127,7 +128,7 @@ var _ = Describe("kumactl get fault-injections", func() {
store = memory_resources.NewStore()

for _, ds := range faultInjectionResources {
err := store.Create(context.Background(), ds, core_store.CreateBy(core_model.MetaToResourceKey(ds.GetMeta())))
err := store.Create(context.Background(), ds, core_store.CreateBy(core_model.MetaToResourceKey(ds.GetMeta())), core_store.CreatedAt(t1))
Expect(err).ToNot(HaveOccurred())
}

Expand Down
4 changes: 4 additions & 0 deletions app/kumactl/cmd/get/testdata/get-fault-injections.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"type": "FaultInjection",
"mesh": "default",
"name": "fi1",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"sources": [
{
"match": {
Expand Down Expand Up @@ -38,6 +40,8 @@
"type": "FaultInjection",
"mesh": "default",
"name": "fi2",
"creationTime": "2018-07-17T16:05:36.995Z",
"modificationTime": "2018-07-17T16:05:36.995Z",
"sources": [
{
"match": {
Expand Down
4 changes: 4 additions & 0 deletions app/kumactl/cmd/get/testdata/get-fault-injections.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ items:
responseBandwidth:
limit: 50 mbps
percentage: 50
creationTime: 2018-07-17T16:05:36.995Z
destinations:
- match:
service: backend
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: fi1
sources:
- match:
Expand All @@ -29,10 +31,12 @@ items:
responseBandwidth:
limit: 50 mbps
percentage: 50
creationTime: 2018-07-17T16:05:36.995Z
destinations:
- match:
service: redis
mesh: default
modificationTime: 2018-07-17T16:05:36.995Z
name: fi2
sources:
- match:
Expand Down

0 comments on commit cc845a1

Please sign in to comment.