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

krel: fix layout used to parse GCB time #2366

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Dec 16, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

The layout we currently use doesn't work well if GCB returns a time that has less than 9 digits in seconds fraction. In such cases, it returns an error such as:

parsing the start job time: parsing time "2021-12-15T11:50:49.445350Z" as "2006-01-02T15:04:05.000000000Z": cannot parse ".445350Z" as ".000000000"

This error can be reproduced by running the following krel history command:

krel history --branch release-1.21 --date-from 2021-12-15

In this concrete case -- where we pass time returned by GCB, we want to allow any number of digits in seconds fraction.

Which issue(s) this PR fixes:

None

Does this PR introduce a user-facing change?

krel: fix layout used to parse GCB time

The layout we currently use doesn't work well if GCB returns time that
has less than 6 digits in seconds fraction. In such cases, it returns an
error such as:

parsing the end job time: parsing time "2021-12-15T13:25:53.713850050Z"
as "2006-01-02T15:04:05.000000Z": cannot parse "050Z" as "Z"

In this concrete case -- where we pass time returned by GCB, we want to
allow any number of digits in the seconds fraction.

Signed-off-by: Marko Mudrinić <[email protected]>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 16, 2021
@k8s-ci-robot k8s-ci-robot added sig/release Categorizes an issue or PR as relevant to SIG Release. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 16, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 16, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert, xmudrii

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit f6701ef into kubernetes:master Dec 16, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Dec 16, 2021
@xmudrii xmudrii deleted the time-layout branch December 16, 2021 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants