Skip to content
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

Support globs in custom/buildpacks builder deps #3878

Merged
merged 1 commit into from Mar 30, 2020

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Mar 26, 2020

Fixes #3826

Signed-off-by: David Gageot david@gageot.net

@codecov
Copy link

codecov bot commented Mar 26, 2020

Codecov Report

Merging #3878 into master will decrease coverage by 0.03%.
The diff coverage is 73.91%.

Impacted Files Coverage Δ
pkg/skaffold/build/custom/dependencies.go 76.47% <100%> (-6.87%) ⬇️
pkg/skaffold/build/buildpacks/dependencies.go 100% <100%> (ø) ⬆️
pkg/skaffold/build/list/list.go 71.42% <71.42%> (ø)
pkg/skaffold/docker/dependencies.go 72.91% <0%> (-2.09%) ⬇️
...affold/kubernetes/portforward/kubectl_forwarder.go 68.29% <0%> (+2.43%) ⬆️

Copy link
Member

@briandealwis briandealwis left a comment

Choose a reason for hiding this comment

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

I'm a bit leery of using docker glob semantics for a non-docker builder (viz the docker.WalkWorkspace's use of docker's NewFilePattern).

More broadly, I'm a bit concerned about the different globbing matchers in use. We have our own util.ExpandPathsGlob() and we also pull in github.com/bmatcuk/doublestar for globs elsewhere.

I don't know how these different globs are different. It might make sense to use specific styles (e.g., docker-style for the docker builder), though that can also be confusing.

}
}

files, err := docker.WalkWorkspace(workspace, excludes, paths)
Copy link
Member

Choose a reason for hiding this comment

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

Could we get invert this dependency? It really just uses docker's fileutils.NewPatternMatcher() to process the excludes globs and then does a normal godirwalk.Walk()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to make it work and then I definitely was planning on improving the codebase. We have too many functions where we walk the workspace.

pkg/skaffold/build/list/list.go Outdated Show resolved Hide resolved
Fixes GoogleContainerTools#3826

Signed-off-by: David Gageot <david@gageot.net>
@dgageot dgageot merged commit 0fb5a24 into GoogleContainerTools:master Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom/Buildpack builders should support glob patterns for dependencies
4 participants