[v0.12 backport] replace dockerfile/dockerignore with patternmatcher/ignorefile#4170
Closed
thaJeztah wants to merge 6 commits intomoby:v0.12from
Closed
[v0.12 backport] replace dockerfile/dockerignore with patternmatcher/ignorefile#4170thaJeztah wants to merge 6 commits intomoby:v0.12from
thaJeztah wants to merge 6 commits intomoby:v0.12from
Conversation
- don't use a temp-file for the test as all we need is a reader - use a const and string-literal for the test-content, which makes it slightly more readable - don't use hard-coded tests for each line, but use an "expected" slice - don't fail early if line-numbers don't match Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 01b25b1) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use "doc links" where possible, and better describe the function. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit d116081) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
While this function would usually be used for read a `.dockerignore` file,
it accepts a Reader and can also be used to handle ignore patterns from
other files (e.g. `Dockerfile.dockerignore`) or other sources. The error
was also wrapped multiple times in some code-paths, which could lead to
an error being formatted as:
failed to parse dockerignore: error reading .dockerignore: <some error>
Let's remove mention of the `.dockerignore` filename from the error, and
leave it to the caller to include the filename.
This patch also brings the MainContext dockerignore error inline with the
NamedContext dockerignore error, now printing the exact name of the file.
Co-authored-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7eb2cea)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- integrate frontend/dockerfile/dockerignore from buildkit full diff: moby/patternmatcher@v0.5.0...v0.6.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 9f013f4) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The BuildKit dockerignore package was integrated in the patternmatcher repository / module. This patch updates our uses of the BuildKit package with its new location. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit cb63b9c) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This package was moved to github.com/moby/patternmatcher/ignorefile. Mark the alias as deprecated. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 376e9c8) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport of:
cherry-picks were clean