Skip to content

Fix handling of whitelisted directories in dockerignore#2589

Merged
priyawadhwa merged 1 commit intoGoogleContainerTools:masterfrom
corneliusweig:w/whitelist-dockerignore
Aug 2, 2019
Merged

Fix handling of whitelisted directories in dockerignore#2589
priyawadhwa merged 1 commit intoGoogleContainerTools:masterfrom
corneliusweig:w/whitelist-dockerignore

Conversation

@corneliusweig
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

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

dockerfile: copyDirectory,
workspace: "docker/..",
ignore: "bar\ndocker/*\n*.go",
ignore: "bar\ndocker\n*.go",
Copy link
Copy Markdown
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
Copy Markdown
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