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

Add CompressWithoutPreservingPath to tar package #83

Merged
merged 1 commit into from
May 26, 2023

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented May 26, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

The default way the tar.Compress function works is that we preserve the path between tarFilePath and tarContentsPath directories inside the archive.

This might not work well if tarFilePath and tarContentsPath are on different levels in the file system (e.g. they don't have a common parent directory). In such case we can disable preserveRootDirStructure flag which will make paths inside the archive relative to tarContentsPath.

The test case of this newly-added function describes what I'm trying to accomplish.

Special notes for your reviewer:

I don't like CompressWithoutPreservingPath function name and I'm very welcome to any ideas. 🙃

Does this PR introduce a user-facing change?

Add `CompressWithoutPreservingPath` function to the `tar` package

/assign @saschagrunert @cpanato
cc @kubernetes-sigs/release-engineering

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label May 26, 2023
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 26, 2023
@k8s-ci-robot k8s-ci-robot requested a review from cpanato May 26, 2023 10:08
@k8s-ci-robot k8s-ci-robot added the sig/release Categorizes an issue or PR as relevant to SIG Release. label May 26, 2023
@k8s-ci-robot k8s-ci-robot requested a review from Verolop May 26, 2023 10:08
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 26, 2023
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 26, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, xmudrii

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit f7d5a1f into kubernetes-sigs:main May 26, 2023
@xmudrii xmudrii deleted the tar-structure branch May 26, 2023 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants