-
Notifications
You must be signed in to change notification settings - Fork 339
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
Conversation
* added creationTime and modificationTime in resource Feature kumahq#661
* updated api server tests Feature kumahq#661
* updated tests Feature kumahq#661
…jections * updated tests Feature kumahq#661
…hecks * updated tests Feature kumahq#661
* updated tests Feature kumahq#661
…mplates * updated tests Feature kumahq#661
…logs * updated tests Feature kumahq#661
…permissions * updated tests Feature kumahq#661
…routes * updated tests Feature kumahq#661
…traces * updated tests Feature kumahq#661
…planes * updated tests Feature kumahq#661
* fixed tests for printer Feature kumahq#661
* fixed remote store create and update function and updated tests Feature kumahq#661
* fixed apply tests Feature kumahq#661
Type: string(res.GetType()), | ||
Name: opts.Name, | ||
Mesh: opts.Mesh, | ||
CreationTime: opts.CreationTime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be set by the client. CreationTime is set on the server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then during creation or modification, I need to remove the createdAt
and modifiedAt
in kumactl apply
right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Type: string(res.GetType()), | ||
Name: res.GetMeta().GetName(), | ||
Mesh: res.GetMeta().GetMesh(), | ||
ModificationTime: opts.ModificationTime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be set by the client. ModificationTime is set on the server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
app/kumactl/cmd/apply/apply.go
Outdated
@@ -222,9 +224,9 @@ func (m meta) GetMesh() string { | |||
} | |||
|
|||
func (m meta) GetCreationTime() time.Time { | |||
return time.Unix(0, 0) // the date doesn't matter since it is set on server side anyways | |||
return m.CreationTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment is still relevant. This should be set on the server-side.
Hey, I tested this functionality and I found some issues that creation and modification time is always zero. After debugging it a bit I found the solution.
here is a patch for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also include CHANGELOG. Thanks.
app/kumactl/cmd/apply/apply.go
Outdated
Name string | ||
Mesh string | ||
CreationTime time.Time | ||
ModificationTime time.Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed though? I think we can revert this file to master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but not sure if I revert it to master, GetCreationTime()
is time.Unix
and it will be different for each machine and the test will fail in ci.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time.Unix(0, 0)
indicates the constant time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
BeforeEach(func() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert such files (I see a couple of them) with an empty line change to master?
It's easier to review and less potential conflicts
Hi Jakub, Can I update the existing tests with unmarshalling for unmarshalling the time? or add separate tests. |
Update existing please |
thank you for the contribution |
Summary
Exposed creationTime and modifiedTime from rest-api
Full changelog
creationTime
andmodificationTime
Issues resolved
Fix #661