feat: improves ValidateContextDirectory performance#1577
feat: improves ValidateContextDirectory performance#1577thaJeztah merged 2 commits intodocker:masterfrom
Conversation
|
Please sign your commits following these rules: $ git clone -b "1576-improve-validate-context-directory" git@github.com:orisano/cli.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
d13a5ca to
8157fb8
Compare
Codecov Report
@@ Coverage Diff @@
## master #1577 +/- ##
==========================================
+ Coverage 56.26% 56.26% +<.01%
==========================================
Files 308 308
Lines 21293 21301 +8
==========================================
+ Hits 11980 11986 +6
- Misses 8439 8440 +1
- Partials 874 875 +1 |
cli/command/image/build/context.go
Outdated
| matches := func(file string) (bool, error) { | ||
| file = filepath.Clean(file) | ||
| if file == "." { | ||
| // Don't let them exclude everything, kind of silly. |
There was a problem hiding this comment.
I'm not sure we can ignore this case; I know there's repositories using this (i.e. have .dockerignore with . in it, to not send anything)
There was a problem hiding this comment.
https://github.com/docker/cli/blob/master/vendor/github.com/docker/docker/pkg/fileutils/fileutils.go#L217-L232
that is fileutils.Matches's implementation.
There was a problem hiding this comment.
Hm... interesting. I definitely have seen people using this in their .dockerignore. Wondering if it worked at all for them (haven't tried it)
There was a problem hiding this comment.
I think we should add a test case here, or at least copy the tests from https://github.com/moby/moby/blob/master/pkg/fileutils/fileutils_test.go#L221 (as the code was copied too), and maybe it will need to extract this inlined function.
There was a problem hiding this comment.
i added test cases
fea0322 to
b9d6b5d
Compare
|
what is the current status of this pr? |
|
@thaJeztah PTAL 🦁 |
Signed-off-by: Nao YONASHIRO <owan.orisano@gmail.com>
Signed-off-by: Nao YONASHIRO <owan.orisano@gmail.com>
b9d6b5d to
446762d
Compare
|
sorry, what is the current status of this pr? |
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM
sorry, this one dropped of my list 😊
for #1576
reduces PatternMatcher construction.