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

fix(kuma-cp): set creationTime on KDS sync #8945

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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"
lobkovilya marked this conversation as resolved.
Show resolved Hide resolved
"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