-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix handling of whitelisted directories in dockerignore #2589
Conversation
Codecov Report
|
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>
27eecc5
to
86100a7
Compare
Thanks for tackling this @corneliusweig ! Did you get a chance to try the fix on the sample repo provided in the bug? |
@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", |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
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