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

Skip the /kaniko directory when copying root #2863

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

JeromeJu
Copy link
Collaborator

@JeromeJu JeromeJu commented Nov 21, 2023

Prior to this change, the files under the /kaniko dir is also attempted to be copied. This commit adds the skip option for otiai10.Copy to skip the /kaniko directory when the root is being copied. The files under /kaniko dir should be ignored and thus this shall not cause any loss of information.
fixes: #2033

Description

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

This commit adds the skip option for otiai10.Copy to skip the /kaniko
directory when the root is being copied. The files under /kaniko dir
should be ignored and thus this shall not cause any loss of information.

fixes: GoogleContainerTools#2033
FROM busybox:1.31
COPY context/foo foo

FROM alpine@sha256:5ce5f501c457015c4b91f91a15ac69157d9b06f1a75cf9107bf2b62e0843983a
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have full context, but could you help explain how does this dockerfile tests the logic change?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, is the release note related to the PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have full context, but could you help explain how does this dockerfile tests the logic change?

Prior to this change, when the source "/" is specified, we will see errors described at #2033 (comment) with recursive /kaniko/0 in the names. This test case test copying from root and the kaniko/0 folder shall not be apparent.

I also added a sentence for the previous situation in the message. Thanks for pointing this out.

Copy link
Collaborator

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

LGTM! Just testing this locally and it works great, thanks for fixing this!

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.

Multi stage build ends with "no space left on device", no matter the free space you provide
3 participants