Skip to content

skaffold init and buildpacks: skip dependencies#3758

Merged
balopat merged 2 commits intoGoogleContainerTools:masterfrom
dgageot:fix-#3568
Feb 28, 2020
Merged

skaffold init and buildpacks: skip dependencies#3758
balopat merged 2 commits intoGoogleContainerTools:masterfrom
dgageot:fix-#3568

Conversation

@dgageot
Copy link
Copy Markdown
Contributor

@dgageot dgageot commented Feb 28, 2020

Fixes #3568

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

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

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%) ⬆️

Fixes GoogleContainerTools#3568

Signed-off-by: David Gageot <david@gageot.net>
Copy link
Copy Markdown
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.

{
description: "NodeJS",
path: "path/to/package.json",
path: filepath.Join("path", "to", "package.json"),
Copy link
Copy Markdown
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
Copy Markdown
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 <david@gageot.net>
name := filepath.Base(path)
switch filepath.Base(path) {
case "package.json":
return !hasParent(path, "node_modules")
Copy link
Copy Markdown
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