-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
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.
There was a problem hiding this 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
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) |
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 Report
@@ 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
Continue to review full report at Codecov.
|
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