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

fix(kuma-cp) add creation time #903

merged 3 commits into from
Jul 22, 2020

Conversation

lobkovilya
Copy link
Contributor

Summary

Add creation time during storage syncing

Full changelog

  • [Implement ...]
  • [Fix ...]

Issues resolved

Fix #XXX

Documentation

@lobkovilya lobkovilya requested a review from a team as a code owner July 14, 2020 20:53
Copy link
Contributor

@nickolaev nickolaev left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -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

@lobkovilya lobkovilya merged commit c2c4ebe into master Jul 22, 2020
@lobkovilya lobkovilya deleted the fix/creation-time branch July 29, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants