-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use fixed fileutils matching functions #2319
Use fixed fileutils matching functions #2319
Conversation
3c9e31b
to
9872d46
Compare
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.
The changes look good to me. It looks like there were tests added to the upstream PR, but I wonder if we should replicate some of those tests here in checksum_test.go
? Minimally it looks like we can add something like this to the end of TestChecksumIncludeDoubleStar
:
dgst, err = cc.Checksum(context.TODO(), ref, "prefix/a", ChecksumOpts{IncludePatterns: []string{"**/foo", "**/report"}}, nil)
require.NoError(t, err)
// Now there is a file included
require.Equal(t, dgstDoubleStar, dgst)
// Same, with Wildcard = true
dgst, err = cc.Checksum(context.TODO(), ref, "prefix/a", ChecksumOpts{IncludePatterns: []string{"**/foo", "**/report"}, Wildcard: true}, nil)
require.NoError(t, err)
require.Equal(t, dgstDoubleStar, dgst)
where previously we only looked for **/foo/**
?
This is important for two reasons: 1) Keeps caching logic consistent with recent fsutil changes to use these functions (also vendored here). 2) Allows us to move forward with removal of the original buggy Matches implementation in moby/moby. Signed-off-by: Aaron Lehmann <[email protected]>
9872d46
to
8021a3e
Compare
Done. |
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.
LGTM
@tonistiigi: Is this okay to merge? |
This is important for two reasons:
Keeps caching logic consistent with recent fsutil changes to use
these functions (also vendored here).
Allows us to move forward with removal of the original buggy Matches
implementation in moby/moby.