Skip to content

skaffold init and buildpacks: skip dependencies #3758

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

Merged
merged 2 commits into from
Feb 28, 2020

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Feb 28, 2020

Fixes #3568

Signed-off-by: David Gageot [email protected]

@dgageot dgageot changed the title Skip dependencies skaffold init and buildpacks: skip dependencies Feb 28, 2020
@codecov
Copy link

codecov bot commented Feb 28, 2020

Codecov Report

Merging #3758 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
pkg/skaffold/build/buildpacks/init.go 92.3% <100%> (+4.8%) ⬆️
...affold/kubernetes/portforward/kubectl_forwarder.go 65.85% <0%> (-2.44%) ⬇️
pkg/skaffold/sync/sync.go 72.57% <0%> (+0.31%) ⬆️

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.

LGTM but we should log something to the users since the node_modules and vendor packages are not unusual to be found.

@@ -32,17 +32,27 @@ func TestValidate(t *testing.T) {
}{
{
description: "NodeJS",
path: "path/to/package.json",
path: filepath.Join("path", "to", "package.json"),
Copy link
Contributor

Choose a reason for hiding this comment

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

just for completeness add corner test cases for
go.mod, package.json -> i.e. no filepath.Base = empty string
and somedir/vendor/go.mod -> i.e vendor not first parent.

Copy link
Contributor

@tejal29 tejal29 left a comment

Choose a reason for hiding this comment

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

LGTM. just few nits on more test cases

@tejal29 tejal29 self-assigned this Feb 28, 2020
Signed-off-by: David Gageot <[email protected]>
name := filepath.Base(path)
switch filepath.Base(path) {
case "package.json":
return !hasParent(path, "node_modules")
Copy link
Contributor

Choose a reason for hiding this comment

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

how about using filepath.Match instead?

@balopat balopat merged commit 4cce4f5 into GoogleContainerTools:master Feb 28, 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.

skaffold init looks for go.mod files under vendor/
5 participants