Skip to content

Add filter support for walker#10

Merged
tonistiigi merged 1 commit intomasterfrom
walker-filter
Sep 15, 2017
Merged

Add filter support for walker#10
tonistiigi merged 1 commit intomasterfrom
walker-filter

Conversation

@tonistiigi
Copy link
Owner

Allows overriding and filtering walked files, for example for resetting uid/gid.

cc @shouze

Signed-off-by: Tonis Tiigi tonistiigi@gmail.com

walker.go Outdated
type WalkOpt struct {
IncludePaths []string // todo: remove?
ExcludePatterns []string
Filter func(*Stat) bool
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it’s possible to mutate the Stat struct... I’m not sure that Filter is self descriptive enough. It’s more close to map/reduce in fact.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Copy link

@shouze shouze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tonistiigi tonistiigi merged commit 7db8911 into master Sep 15, 2017
@shouze
Copy link

shouze commented Sep 21, 2017

@tonistiigi back to work - can you confirm that to reset uid/gid to 0 when docker image build is in stream mode, I have to patch buildkit sendDiffCopy to pass a had hoc Map WalkOpt?

Also, can you confirm it will based on DiffCopy as it looks like that TarStream has been removed from buildkit? (so this part is currently dead code since diffcopy is the only supported protocol now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants