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

Move sync code to pkg/skaffold/sync/kubectl #1138

Merged
merged 2 commits into from
Oct 10, 2018

Conversation

priyawadhwa
Copy link
Contributor

This is the correct place for this code. Might require some
reorganization if we add other syncers, like rsync, but that shouldn't
be difficult.

Should fix #1136

This is the correct place for this code. Might require some
reorganization if we add other syncers, like rsync, but that shouldn't
be difficult.
Copy link
Contributor

@r2d4 r2d4 left a comment

Choose a reason for hiding this comment

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

nit: func perform should be moved to sync.go? and its test to sync_test.go

@r2d4
Copy link
Contributor

r2d4 commented Oct 10, 2018

and the linter issue

pkg/skaffold/sync/kubectl/kubectl.go:34:6: type name will be used as kubectl.KubectlSyncer by other packages, and that stutters; consider calling this Syncer (golint)

Copy link
Contributor

@r2d4 r2d4 left a comment

Choose a reason for hiding this comment

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

one more nit! and then good to go

@@ -108,3 +112,44 @@ func intersect(context string, syncMap map[string]string, files []string) (map[s
}
return ret, nil
}

func Perform(ctx context.Context, image string, files map[string]string, cmdFn func(context.Context, v1.Pod, v1.Container, string, string) *exec.Cmd) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can still leave this as unexported, I dont think we want it used outside the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so the Sync function in the kubectl package calls it, so I think it has to be exported?

Copy link
Contributor

Choose a reason for hiding this comment

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

doh you are correct, LGTM then

@codecov-io
Copy link

codecov-io commented Oct 10, 2018

Codecov Report

Merging #1138 into master will decrease coverage by 0.52%.
The diff coverage is 82.6%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1138      +/-   ##
==========================================
- Coverage   42.88%   42.35%   -0.53%     
==========================================
  Files          89       89              
  Lines        3915     3978      +63     
==========================================
+ Hits         1679     1685       +6     
- Misses       2069     2125      +56     
- Partials      167      168       +1
Impacted Files Coverage Δ
pkg/skaffold/runner/runner.go 50.2% <100%> (ø) ⬆️
pkg/skaffold/sync/sync.go 90.32% <81.81%> (-4.68%) ⬇️
cmd/skaffold/app/cmd/cmd.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/dev.go 0% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/fix.go 0% <0%> (ø) ⬆️
pkg/skaffold/watch/changes.go 97.87% <0%> (ø) ⬆️
cmd/skaffold/app/cmd/diagnose.go 0% <0%> (ø)
pkg/skaffold/docker/client.go 58.13% <0%> (+2.32%) ⬆️
pkg/skaffold/schema/versions.go 56.75% <0%> (+3.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bc2ca6...971c262. Read the comment docs.

@r2d4 r2d4 merged commit 060791e into GoogleContainerTools:master Oct 10, 2018
@priyawadhwa priyawadhwa deleted the sync branch October 10, 2018 23:22
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.

move pkg/skaffold/kubernetes/sync* to pkg/skaffold/sync/kubectl
3 participants