-
Notifications
You must be signed in to change notification settings - Fork 250
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
Support for SOURCE_DATE_EPOCH
in tkn bundle push
#2137
Conversation
This refactor should make it easier to test setting ctime.
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 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. |
any chance you can explain why this is needed ? and what is this needed to be a flag ? is it expected to be used by a large number of users? i am afraid having more and more flags in CLI with no clear explanation of what it does will just end up confusing and a burden for the maintainers. |
SOURCE_TIME_EPOCH
in tkn bundle push
SOURCE_DATE_EPOCH
in tkn bundle push
This is not adding another flag but allowing the existing flag (
Oh, for sure, but we're not adding one here :) |
ah i misread the PR sorry about that, this is fine by me if it's following the spec /ok-to-test |
but another thing, what about making ctime the default? as discussed on another issue i don't believe there is breakage that could happen by changing the behaviour... |
Yeah, I plan on doing that, chose this to do first because of the refactoring that I did here. The followup in #2135 should be just a couple of lines following this PR :) |
I see the tests fail, I'm going to investigate a bit, most likely something to do with the time zones... |
5851a0e
to
5790462
Compare
Took me a minute to realize that the test runner is setting |
When the `SOURCE_DATE_EPOCH` environment variable is set and the `--ctime` parameter is not provided, the unix timestamp from `SOURCE_DATE_EPOCH` will be used for setting the created time of the OCI Tekton bundle image.
5790462
to
ba66b37
Compare
/retest-required |
pkg/cmd/bundle/push_test.go
Outdated
func init() { | ||
// fixed time to ease testing | ||
now = func() time.Time { | ||
return time.Date(2023, 9, 22, 1, 2, 3, 0, time.UTC) |
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.
we usually use fakeclock/clockwork for that
/retest-required |
/lgtm Thanks! |
@@ -22,6 +23,7 @@ import ( | |||
"time" | |||
|
|||
"github.com/google/go-containerregistry/pkg/name" | |||
"github.com/jonboulle/clockwork" |
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.
thanks addressing other parts of the code
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester 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 |
Changes
First commit is a refactoring commit to move the code from
PreRunE
toparseArgsAndFlags
, this is something that in full honesty should have been done on #2133. This way is easier to test the implementation.Second commit introduces support for
SOURCE_TIME_EPOCH
environment variable intkn bundle push
.Fixes #2136
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make check
make generated
See the contribution guide
for more details.
Release Notes