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 bug in copy command by refactoring whitelist checks #231

Merged
merged 3 commits into from
Jul 10, 2018

Conversation

priyawadhwa
Copy link
Collaborator

@priyawadhwa priyawadhwa commented Jul 9, 2018

Should fix #221

The bug was coming from an incorrect whitelist check in RelativeFiles -- I noticed that we had two functions for checking the whitelist in fs_util.go so I removed the one that was broken and replaced all instances of it with CheckWhitelist which is more straightforward.

@priyawadhwa priyawadhwa changed the title remove whitelist check from RelativeFiles [WIP] fix copy bug Jul 9, 2018
@priyawadhwa priyawadhwa changed the title [WIP] fix copy bug Fix bug in copy command by refactoring whitelist checks Jul 9, 2018
@priyawadhwa priyawadhwa merged commit 31b7cd3 into GoogleContainerTools:master Jul 10, 2018
@priyawadhwa priyawadhwa deleted the bug branch July 10, 2018 15:23
bobcatfish added a commit to bobcatfish/kaniko that referenced this pull request Aug 24, 2018
This test had previously (before GoogleContainerTools#231) been making a change to a file in
the kaniko dir, then checking that it isn't being snapshotted. This was
to test the whitelisting logic, which makes sure that changes to /kaniko
aren't included in images. However the test creates a temporary dir, so
the kaniko dir is actually in /tmp/<some temp dir>/kaniko, and
in GoogleContainerTools#231 the logic was simplified to no longer have a special case for
tests. The test continued to pass because `MaybeAdd` noticed that the
kaniko file wasn't changing, and didn't add it. After changing this to
always add the files, it revealed that this was left behind by accident.

I also opened GoogleContainerTools#307 to add integration test coverage for this logic.

I also marked `CheckErrorAndDeepEqual` as a helper function so that when
it fails, the line number reported is where that was called.
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.

COPY command ignores folders with same name as grandparent directory
2 participants