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

Feat/#661 - Exposing creationTime and modificationTime #677

Merged
merged 32 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
665fd13
feature exposed creationTime & modificationTime in kuma
tharun208 Apr 14, 2020
5706587
feature exposed creationTime & modificationTime in kuma
tharun208 Apr 14, 2020
dd2e5b1
feature exposed creationTime & modificationTime for kuma get dataplanes
tharun208 Apr 14, 2020
cc845a1
feature exposed creationTime & modificationTime for kuma get fault in…
tharun208 Apr 14, 2020
af336c9
feature exposed creationTime & modificationTime for kuma get health c…
tharun208 Apr 14, 2020
fbc8468
feature exposed creationTime & modificationTime for kuma get meshes
tharun208 Apr 14, 2020
7f55289
feature exposed creationTime & modificationTime for kuma get proxy Te…
tharun208 Apr 14, 2020
a3198ed
feature exposed creationTime & modificationTime for kuma get traffic …
tharun208 Apr 14, 2020
e8a7445
feature exposed creationTime & modificationTime for kuma get traffic …
tharun208 Apr 14, 2020
6fe53f3
feature exposed creationTime & modificationTime for kuma get traffic …
tharun208 Apr 14, 2020
d8dc012
feature exposed creationTime & modificationTime for kuma get traffic …
tharun208 Apr 14, 2020
fd0ba3c
feature exposed creationTime & modificationTime for kuma inspect data…
tharun208 Apr 14, 2020
e104eb0
feature exposed creationTime & modificationTime for kuma
tharun208 Apr 14, 2020
6acce39
feature exposed creationTime & modificationTime for kuma
tharun208 Apr 14, 2020
0d80de7
feature exposed creationTime & modificationTime for kuma
tharun208 Apr 14, 2020
080c42e
* update api-server resource tests with proper dateTime
tharun208 Apr 14, 2020
1527053
* removed unwanted omitempty tag for creationTime and modificationTime
tharun208 Apr 14, 2020
99117f7
* updated apply dry-run to return noop date-time
tharun208 Apr 14, 2020
84162e1
Merge remote-tracking branch 'origin/master' into feat/#661
tharun208 Apr 15, 2020
522f1e8
Merge remote-tracking branch 'origin/master' into feat/#661
tharun208 Apr 15, 2020
f57aa4f
* updated get single resource test data
tharun208 Apr 15, 2020
e5ed83b
* added createdAt and modifiedAt params to upsert function in apply
tharun208 Apr 15, 2020
0df63c9
updated branch with upstream
tharun208 Apr 17, 2020
196d6ea
fiixed failing tests
tharun208 Apr 17, 2020
8589237
removed storing creation and modification time in client
tharun208 Apr 21, 2020
dc0c940
show default creationTime and modificationTime for all resources in k…
tharun208 Apr 21, 2020
a5b7ad4
Merge remote-tracking branch 'origin/master' into feat/#661
tharun208 Apr 21, 2020
93171c8
show default creationTime and modificationTime in store
tharun208 Apr 21, 2020
c072066
fix(kuma-ctl): reverted back creation and modification time to constant
tharun208 Apr 24, 2020
ac3636c
fix(kuma-ctl): unmarshalling check for creationtime and modification …
tharun208 Apr 24, 2020
64a28e7
rebased with upstream
tharun208 Apr 24, 2020
87cdfdc
updated tests
tharun208 Apr 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CHANGELOG

## master
* feat: expose CreationTime and modificationTime
[#677](https://github.com/Kong/kuma/pull/677)
* feat: pagination in kumactl
[#690](https://github.com/Kong/kuma/pull/690)
* feat: secret management API
Expand Down
5 changes: 3 additions & 2 deletions app/kumactl/cmd/apply/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var _ = Describe("kumactl apply", func() {
var rootCtx *kumactl_cmd.RootContext
var rootCmd *cobra.Command
var store core_store.ResourceStore

BeforeEach(func() {
rootCtx = &kumactl_cmd.RootContext{
Runtime: kumactl_cmd.RootRuntime{
Expand Down Expand Up @@ -374,7 +373,9 @@ var _ = Describe("kumactl apply", func() {

// then
Expect(buf.String()).To(Equal(
`mesh: default
`creationTime: "1970-01-01T05:30:00+05:30"
mesh: default
modificationTime: "1970-01-01T05:30:00+05:30"
name: sample
networking:
address: 2.2.2.2
Expand Down
2 changes: 1 addition & 1 deletion app/kumactl/cmd/get/get_dataplanes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
var _ = Describe("kumactl get dataplanes", func() {

var dataplanes []*mesh_core.DataplaneResource

BeforeEach(func() {
// setup
dataplanes = []*mesh_core.DataplaneResource{
{
Meta: &test_model.ResourceMeta{
Expand Down
1 change: 0 additions & 1 deletion app/kumactl/cmd/get/get_fault_injections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ var _ = Describe("kumactl get fault-injections", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup
rootCtx = &kumactl_cmd.RootContext{
Expand Down
3 changes: 0 additions & 3 deletions app/kumactl/cmd/get/get_healthchecks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
var _ = Describe("kumactl get healthchecks", func() {

var sampleHealthChecks []*mesh_core.HealthCheckResource

BeforeEach(func() {
sampleHealthChecks = []*mesh_core.HealthCheckResource{
{
Expand Down Expand Up @@ -62,10 +61,8 @@ var _ = Describe("kumactl get healthchecks", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup

rootCtx = &kumactl_cmd.RootContext{
Runtime: kumactl_cmd.RootRuntime{
NewResourceStore: func(*config_proto.ControlPlaneCoordinates_ApiServer) (core_store.ResourceStore, error) {
Expand Down
1 change: 0 additions & 1 deletion app/kumactl/cmd/get/get_meshes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ var _ = Describe("kumactl get meshes", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup
rootCtx = &kumactl_cmd.RootContext{
Expand Down
2 changes: 0 additions & 2 deletions app/kumactl/cmd/get/get_proxytemplates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ var _ = Describe("kumactl get proxytemplates", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup

rootCtx = &kumactl_cmd.RootContext{
Runtime: kumactl_cmd.RootRuntime{
NewResourceStore: func(*config_proto.ControlPlaneCoordinates_ApiServer) (core_store.ResourceStore, error) {
Expand Down
3 changes: 0 additions & 3 deletions app/kumactl/cmd/get/get_single_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"io/ioutil"
"path/filepath"
"strings"
"time"

"github.com/Kong/kuma/pkg/catalog"
catalog_client "github.com/Kong/kuma/pkg/catalog/client"
Expand All @@ -29,11 +28,9 @@ var _ = Describe("kumactl get [resource] NAME", func() {
var rootCmd *cobra.Command
var outbuf, errbuf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
rootCtx = &kumactl_cmd.RootContext{
Runtime: kumactl_cmd.RootRuntime{
Now: time.Now,
NewResourceStore: func(*config_proto.ControlPlaneCoordinates_ApiServer) (core_store.ResourceStore, error) {
return store, nil
},
Expand Down
1 change: 0 additions & 1 deletion app/kumactl/cmd/get/get_traffic_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ var _ = Describe("kumactl get traffic-logs", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup
rootCtx = &kumactl_cmd.RootContext{
Expand Down
2 changes: 0 additions & 2 deletions app/kumactl/cmd/get/get_traffic_routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ var _ = Describe("kumactl get traffic-routes", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup

rootCtx = &kumactl_cmd.RootContext{
Runtime: kumactl_cmd.RootRuntime{
NewResourceStore: func(*config_proto.ControlPlaneCoordinates_ApiServer) (core_store.ResourceStore, error) {
Expand Down
1 change: 0 additions & 1 deletion app/kumactl/cmd/get/get_traffic_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ var _ = Describe("kumactl get traffic-traces", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup
rootCtx = &kumactl_cmd.RootContext{
Expand Down
1 change: 0 additions & 1 deletion app/kumactl/cmd/get/get_trafficpermissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ var _ = Describe("kumactl get traffic-permissions", func() {
var rootCmd *cobra.Command
var buf *bytes.Buffer
var store core_store.ResourceStore

BeforeEach(func() {
// setup
rootCtx = &kumactl_cmd.RootContext{
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": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"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: 0001-01-01T00:00:00Z
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: dataplane-1
networking:
address: 127.0.0.1
Expand Down
4 changes: 4 additions & 0 deletions app/kumactl/cmd/get/testdata/get-dataplanes.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{
"mesh": "default",
"name": "experiment",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"networking": {
"address": "127.0.0.1",
"inbound": [
Expand All @@ -29,6 +31,8 @@
{
"mesh": "default",
"name": "example",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"networking": {
"address": "127.0.0.2",
"inbound": [
Expand Down
8 changes: 6 additions & 2 deletions app/kumactl/cmd/get/testdata/get-dataplanes.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
items:
- mesh: default
- creationTime: 0001-01-01T00:00:00Z
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: experiment
networking:
address: 127.0.0.1
Expand All @@ -15,7 +17,9 @@ items:
service: metrics
version: v1
type: Dataplane
- mesh: default
- creationTime: 0001-01-01T00:00:00Z
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: example
networking:
address: 127.0.0.2
Expand Down
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": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"sources": [
{
"match": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ conf:
abort:
httpStatus: 500
percentage: 50
creationTime: 0001-01-01T00:00:00Z
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: fault-injection-1
sources:
- match:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"type": "FaultInjection",
"mesh": "default",
"name": "fi1",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"sources": [
{
"match": {
Expand Down Expand Up @@ -38,6 +40,8 @@
"type": "FaultInjection",
"mesh": "default",
"name": "fi2",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"sources": [
{
"match": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ items:
responseBandwidth:
limit: 50 mbps
percentage: 50
creationTime: 0001-01-01T00:00:00Z
destinations:
- match:
service: backend
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: fi1
sources:
- match:
Expand All @@ -29,10 +31,12 @@ items:
responseBandwidth:
limit: 50 mbps
percentage: 50
creationTime: 0001-01-01T00:00:00Z
destinations:
- match:
service: redis
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: fi2
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": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"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: 0001-01-01T00:00:00Z
destinations:
- match:
service: backend
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: healthcheck-1
sources:
- match:
service: web
type: HealthCheck
8 changes: 6 additions & 2 deletions app/kumactl/cmd/get/testdata/get-healthchecks.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
{
"mesh": "default",
"name": "web-to-backend",
"type": "HealthCheck"
"type": "HealthCheck",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z"
},
{
"mesh": "default",
"name": "backend-to-db",
"type": "HealthCheck"
"type": "HealthCheck",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z"
}
],
"next": null
Expand Down
8 changes: 6 additions & 2 deletions app/kumactl/cmd/get/testdata/get-healthchecks.golden.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
items:
- mesh: default
- creationTime: 0001-01-01T00:00:00Z
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: web-to-backend
type: HealthCheck
- mesh: default
- creationTime: 0001-01-01T00:00:00Z
mesh: default
modificationTime: 0001-01-01T00:00:00Z
name: backend-to-db
type: HealthCheck
next: null
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": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z",
"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: 0001-01-01T00:00:00Z
logging:
backends:
- name: logstash
Expand All @@ -11,6 +11,7 @@ metrics:
prometheus:
path: /non-standard-path
port: 1234
modificationTime: 0001-01-01T00:00:00Z
mtls:
ca:
provided: {}
Expand Down
16 changes: 12 additions & 4 deletions app/kumactl/cmd/get/testdata/get-meshes.golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
}
},
"name": "mesh1",
"type": "Mesh"
"type": "Mesh",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z"
},
{
"mtls": {
Expand All @@ -18,7 +20,9 @@
}
},
"name": "mesh2",
"type": "Mesh"
"type": "Mesh",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z"
},
{
"metrics": {
Expand Down Expand Up @@ -65,7 +69,9 @@
}
},
"name": "mesh3",
"type": "Mesh"
"type": "Mesh",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z"
},
{
"metrics": {
Expand All @@ -86,7 +92,9 @@
}
},
"name": "mesh4",
"type": "Mesh"
"type": "Mesh",
"creationTime": "0001-01-01T00:00:00Z",
"modificationTime": "0001-01-01T00:00:00Z"
}
],
"next": null
Expand Down
Loading