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 handling of whitelisted directories in dockerignore #2589

Conversation

corneliusweig
Copy link
Contributor

This PR fixes handling of whitelisted directories in .dockerignore.

The code closely follows the reference implementation from
https://github.com/docker/cli/blame/f019bdcace678c71690a99f6c5f30303c33534bc/vendor/github.com/docker/docker/pkg/archive/archive.go#L832 Does that already mandate a proper attribution?

Fixes #2576

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #2589 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted Files Coverage Δ
pkg/skaffold/docker/dependencies.go 71.73% <100%> (+3.06%) ⬆️

This code snippet closely follows the reference implementation from
github.com/docker/docker/pkg/archive/archive.go

Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
@corneliusweig corneliusweig force-pushed the w/whitelist-dockerignore branch from 27eecc5 to 86100a7 Compare July 31, 2019 22:03
@priyawadhwa priyawadhwa added the kokoro:run runs the kokoro jobs on a PR label Jul 31, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Jul 31, 2019
@priyawadhwa
Copy link
Contributor

Thanks for tackling this @corneliusweig ! Did you get a chance to try the fix on the sample repo provided in the bug?

@corneliusweig
Copy link
Contributor Author

@priyawadhwa Yes, it runs without error. I also added test-cases to cover these scenarios.

@@ -357,7 +357,7 @@ func TestGetDependencies(t *testing.T) {
description: "dockerignore with context in parent directory",
dockerfile: copyDirectory,
workspace: "docker/..",
ignore: "bar\ndocker/*\n*.go",
ignore: "bar\ndocker\n*.go",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change means the same, but increases test coverage.

Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for fixing this!

@priyawadhwa priyawadhwa merged commit 2db9ef5 into GoogleContainerTools:master Aug 2, 2019
@corneliusweig corneliusweig deleted the w/whitelist-dockerignore branch August 2, 2019 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.dockerignore whitelist rules not respected
4 participants