Skip to content

Convert times to UTC#631

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
zregvart:issue/630
Nov 29, 2022
Merged

Convert times to UTC#631
tekton-robot merged 1 commit into
tektoncd:mainfrom
zregvart:issue/630

Conversation

@zregvart

Copy link
Copy Markdown
Contributor

Changes

The SLSA provenance prescribes that the Timestamp data types must be in UTC time zone. It can happen that the environment where Chains controller is running is not set to the UTC time zone, and in that case the predicate.metadata.buildStartedOn and
predicate.metadata.buildFinishedOn will be set with the local time zone. This is due to apimachinery converting time.Time values into local timezone on JSON unmarshall.

This forces all dates to the UTC time zone.

Fixes #630

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Makes sure all dates in SLSA provenance attestations are in UTC time zone

The SLSA provenance prescribes that the Timestamp data types must be in
UTC time zone. It can happen that the environment where Chains
controller is running is not set to the UTC time zone, and in that case
the `predicate.metadata.buildStartedOn` and
`predicate.metadata.buildFinishedOn` will be set with the local time
zone. This is due to apimachinery converting `time.Time` values into
local timezone on JSON unmarshall.

This forces all dates to the UTC time zone.

Fixes tektoncd#630
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 29, 2022
@tekton-robot

Copy link
Copy Markdown

Hi @zregvart. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@lcarva

lcarva commented Nov 29, 2022

Copy link
Copy Markdown
Contributor

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 29, 2022
@tekton-robot

Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-tekton-chains-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go 77.3% 77.8% 0.5
pkg/chains/formats/intotoite6/taskrun/taskrun.go 76.5% 77.1% 0.7

@wlynch wlynch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

Thanks!

@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wlynch

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@tekton-robot tekton-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 29, 2022
@tekton-robot tekton-robot merged commit 9f59ee7 into tektoncd:main Nov 29, 2022
@zregvart zregvart deleted the issue/630 branch November 29, 2022 19:00
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

in-toto Timestamp values might not be in UTC

4 participants