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

Preserve time and expose link strategy #166

Merged
merged 8 commits into from Apr 11, 2023

Conversation

wobito
Copy link
Contributor

@wobito wobito commented Mar 31, 2023

This PR does two things:

  1. Set the Metadata to hold the file ModTime and other time data when available.
  2. expose the LinkResolutionStrategy to the walk callback via the WalkConditions

The reason for this PR is I'm using stereoscope to parse the squashedtree to a single tar file, and was required to make these little modifications in order to make that process work.

What do you think?

Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>
Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>
@wobito wobito force-pushed the preserve_time_and_expose_link_strat branch from 95cbb45 to 45507db Compare March 31, 2023 20:29
@wagoodman wagoodman self-assigned this Apr 6, 2023
pkg/file/tarutil_test.go Outdated Show resolved Hide resolved
Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>
Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>
Copy link
Contributor

@wagoodman wagoodman 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 the contribution! This should help out with #160 🙌

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman enabled auto-merge (squash) April 11, 2023 19:45
@wagoodman wagoodman merged commit 3282bc0 into anchore:main Apr 11, 2023
6 checks passed
gnmahanth pushed a commit to deepfence/stereoscope that referenced this pull request Jun 15, 2023
* bind file times to metadata

Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>

* expose link strategy to walkConditions

Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>

* update: test times

Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>

* update: link options api

Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>

* stub mod time for dynamic tar test fixtures

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* set mtime on tar fixture explicitly

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* always interpret tar header timestamps as UTC

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* interpret all file metadata timestamps as UTC

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

---------

Signed-off-by: Adrian Wobito <adrian.wobito@gmail.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants