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
kubectl: fix the Scheduled eventTime is <unknown> when printing event #90227
Conversation
Hi @gosoon. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/sig cli |
/area kubectl |
Thanks for your PR, but seems this is dup of #89999 which is still waiting for another review. |
Ok, I have changed the commit content and only fixed the |
@@ -3642,6 +3642,9 @@ func DescribeEvents(el *corev1.EventList, w PrefixWriter) { | |||
interval = fmt.Sprintf("%s (x%d over %s)", translateTimestampSince(e.LastTimestamp), e.Count, translateTimestampSince(e.FirstTimestamp)) | |||
} else { | |||
interval = translateTimestampSince(e.FirstTimestamp) | |||
if e.FirstTimestamp.IsZero() { | |||
interval = translateTimestampSince(metav1.Time(e.EventTime)) |
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.
EventTime
is metav1.MicroTime
but not metav1.Time
. So you need another translateMicroTimestampSince
. Like #89999
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.
done
/ok-to-test |
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.
/approve
/priority backlog
/retest
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gosoon, soltysh 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 |
We're seeing this issue in one of our 1.16.8 clusters. Can we get the fix added to a 1.16 point release? |
@gosoon We're having this problem with one of our 1.16 clusters and are wondering when/if there will be a 1.16 patch release to fix it. Do you know? |
…90227-upstream-release-1.18 Automated cherry pick of #90227: kubectl: fix the Scheduled eventTime is <unknown> when use kubectl describe pod xxx
@dmcnaught Hello Duncan, 1.16 is no longer receiving the patch releases, I recommend you to upgrade your cluster to 1.17 at least. |
…90227-release-1.17 Automated cherry pick of #90227: kubectl: fix the Scheduled eventTime is <unknown> when use
yes - we upgraded to 1.17 in July/August. There was a PR in our PaaS that helps up around the unknown timestamps: teamhephy/controller#129 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
When scheduler using v1beta1.events(#78447),the
Scheduled
event is not set the LastTimestamp and the FirstTimestamp,only set the EventTime,so usekubectl get event and kubectl describe pod xxx
you will see that the timestamp of thescheduled
event is<unknown>
,as shown below,in those cases we fallback to eventTime.Which issue(s) this PR fixes:
Fixes # 89689
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: