Skip to content

Commit

Permalink
fix(kuma-cp): set creationTime on KDS sync (#8945)
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Lobkov <[email protected]>
  • Loading branch information
lobkovilya authored Jan 23, 2024
1 parent 17025b3 commit 7a68c4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/kds/store/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/go-logr/logr"

"github.com/kumahq/kuma/pkg/core"
"github.com/kumahq/kuma/pkg/core/resources/apis/system"
core_model "github.com/kumahq/kuma/pkg/core/resources/model"
"github.com/kumahq/kuma/pkg/core/resources/registry"
Expand Down Expand Up @@ -145,11 +146,10 @@ func (s *syncResourceStore) Sync(upstream core_model.ResourceList, fs ...SyncOpt
for _, r := range onCreate {
rk := core_model.MetaToResourceKey(r.GetMeta())
log.Info("creating a new resource from upstream", "name", r.GetMeta().GetName(), "mesh", r.GetMeta().GetMesh())
creationTime := r.GetMeta().GetCreationTime()

createOpts := []store.CreateOptionsFunc{
store.CreateBy(rk),
store.CreatedAt(creationTime),
store.CreatedAt(core.Now()),
store.CreateWithLabels(r.GetMeta().GetLabels()),
}
if opts.Zone != "" {
Expand Down
3 changes: 1 addition & 2 deletions pkg/kds/v2/store/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,10 @@ func (s *syncResourceStore) Sync(syncCtx context.Context, upstreamResponse clien
for _, r := range onCreate {
rk := core_model.MetaToResourceKey(r.GetMeta())
log.Info("creating a new resource from upstream", "name", r.GetMeta().GetName(), "mesh", r.GetMeta().GetMesh())
creationTime := r.GetMeta().GetCreationTime()

createOpts := []store.CreateOptionsFunc{
store.CreateBy(rk),
store.CreatedAt(creationTime),
store.CreatedAt(core.Now()),
store.CreateWithLabels(r.GetMeta().GetLabels()),
}
if opts.Zone != "" {
Expand Down

0 comments on commit 7a68c4c

Please sign in to comment.