Skip to content

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

Merged
jonjohnsonjr merged 1 commit intogoogle:mainfrom
BronzeDeer:fix-mutate-timestamps-pax-gnu
Feb 1, 2023
Merged

fix(mutate): also set timestamps only present in some formats#1550
jonjohnsonjr merged 1 commit intogoogle:mainfrom
BronzeDeer:fix-mutate-timestamps-pax-gnu

Conversation

@BronzeDeer
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Contributor

@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!

@BronzeDeer
Copy link
Copy Markdown
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