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

fix(mutate): also set timestamps only present in some formats #1550

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

BronzeDeer
Copy link
Contributor

@BronzeDeer BronzeDeer commented Jan 31, 2023

fixes #1523

Currently, layerTime only mutates the modification timestamp which is present in all tar formats. When working with layers GNU or PAX header formats, access and change timestamps are also generated/recorded. This breaks functionality like reproducible builds which rely on having control over all variable fields (esp. timestamps) in the layers

This commit adds a special case to the layerTime(Layer, Time) function which will also set the additional timestamps if the header is of GNU or PAX format

Signed-off-by: Joel Pepper pepper@bronze-deer.de

Currently, layerTime only mutates the modification timestamp which is
present in all tar formats. When working with layers GNU or PAX header
formats, access and change timestamps are also generated/recorded. This
breaks functionality like reproducible builds which rely on having
control over all variable fields (esp. timestamps)  in the layers

This commit adds a special case to the layerTime(Layer, Time) function
which will also set the additional timestamps if the header is of GNU or
PAX format

Signed-off-by: Joel Pepper <pepper@bronze-deer.de>
@google-cla
Copy link

google-cla bot commented Jan 31, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

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

Thanks for this change!

pkg/v1/mutate/mutate.go Show resolved Hide resolved
@BronzeDeer
Copy link
Contributor Author

@imjasonh can we get this merged into trunk? Then I can go ahead and create a PR for kaniko, which has had broken reproducible builds for over a year

@jonjohnsonjr jonjohnsonjr merged commit 824efc7 into google:main Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ggcr: mutate.Time should set AccessTime and ChangeTime
3 participants