-
Notifications
You must be signed in to change notification settings - Fork 20
Add LastModifiedTime to Status for ScalableTarget and ScalingPolicy resources #40
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
Add LastModifiedTime to Status for ScalableTarget and ScalingPolicy resources #40
Conversation
e28d033
to
2d9432f
Compare
svcapitypes "github.com/aws-controllers-k8s/applicationautoscaling-controller/apis/v1alpha1" | ||
svcsdk "github.com/aws/aws-sdk-go/service/applicationautoscaling" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"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.
Need reordering
|
||
// customSetOutputUpdate sets the LastModifiedTime field to the current time post an update | ||
func (rm *resourceManager) customSetLastModifiedTime(ko *svcapitypes.ScalingPolicy) { | ||
currentTime := metav1.Time{Time: time.Now()} |
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.
Will this time.now() local time be the same as the time zone shown in 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.
They should all be in UTC now
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.
Should be UTC since CreationTime is in UTC
2d9432f
to
eed1c66
Compare
eed1c66
to
1a07061
Compare
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.
👍
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jaypipes, mbaijal The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
2 things
Do you think it's better to set the modified time = creation time post create instead of current time post api response?
Can you add an assert to integ tests. Notebook lifecycle config has a similar assert
Description of changes: release artifacts for release v0.0.3 Release Notes draft: This release includes the following resources and updates: - Update ACK Runtime from 0.13.0 to 0.13.2 ( #41 ) - Please refer to https://github.com/aws-controllers-k8s/runtime/releases for a detailed list of changes - The Status field now includes the CreationTime as recorded by the server ( #39 ). - The Status field also includes the `LastModifiedTime` which records the time the resource was last updated ( #40 ). - Includes updates to the README file ( #37 ) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: Fixing [comment](#40 (review)) on previous PR #40 Description of changes: - Use the CreationTime to update LastModifiedTime - Add associated test to check LastModifiedTime By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description of changes:
Add LastModifiedTime to Status for ScalableTarget and ScalingPolicy resources
TODO: Timezone of
CreationTimestamp
is different from theCreationTime
andLastModifiedTime
Testing:
Output as shown below:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.