-
Notifications
You must be signed in to change notification settings - Fork 824
build: add --source-date-epoch and --rewrite-timestamp flags #6208
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
build: add --source-date-epoch and --rewrite-timestamp flags #6208
Conversation
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, LGTM. Just one non-blocking note.
|
||
if options.SourceDateEpoch != nil { | ||
if options.Timestamp != nil { | ||
return "", nil, errors.New("timestamp and source-date-epoch would be ambiguous if allowed together") |
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.
This could be mentioned in the manpage.
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.
Added, thanks.
Use $SOURCE_DATE_EPOCH as the default for the --source-date-epoch flag to the "build" CLI. When a source-date-epoch is set, we'll use it when writing new history entries, force timestamps in data written for --output to the specified timestamp, and populate a "SOURCE_DATE_EPOCH" ARG that we treat as always being set, and which we don't complain about being left unused. By default, this will not affect timestamps in newly-added layers. Add a --rewrite-timestamp flag, which "clamps" timestamps in newly-added layers to not be later than the --source-date-epoch value if the --source-date-epoch flag is set, but has no effect otherwise. Signed-off-by: Nalin Dahyabhai <[email protected]>
fd8a8e8
to
865dace
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: giuseppe, nalind 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Use $SOURCE_DATE_EPOCH as the default for the
--source-date-epoch
flag to the "build" CLI.When a source-date-epoch is set, we'll use it when writing new history entries, force timestamps in data written for
--output
to the specified timestamp, and populate a "SOURCE_DATE_EPOCH" ARG that we treat as always being set, and which we don't complain about being left unused. By default, this will not affect timestamps in newly-added layers.Add a
--rewrite-timestamp
flag, which "clamps" timestamps in newly-added layers to not be later than the--source-date-epoch
value if the--source-date-epoch
flag is set, but has no effect otherwise.Fix a bug in the
dir_image_last_diff()
helper function introduced in a57e7f4 as part of #6178.How to verify it
New integration tests!
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Does this PR introduce a user-facing change?