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) add creation time #903

Merged
merged 3 commits into from
Jul 22, 2020
Merged
Changes from 1 commit
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: 3 additions & 1 deletion pkg/kds/store/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package store
import (
"context"
"reflect"
"time"

"github.com/go-logr/logr"

Expand Down Expand Up @@ -119,7 +120,8 @@ func (s *syncResourceStore) Sync(upstream model.ResourceList, fs ...SyncOptionFu
s.log.Info("creating a new resource from upstream", "resourceKey", rk)
// some Stores try to cast ResourceMeta to own Store type that's why we have to set meta to nil
r.SetMeta(nil)
if err := s.resourceStore.Create(ctx, r, store.CreateBy(rk)); err != nil {
now := time.Now()
if err := s.resourceStore.Create(ctx, r, store.CreateBy(rk), store.CreatedAt(now)); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be taken from KumaResource#creation_time
also take into account KumaResource#modification_time

return err
}
}
Expand Down