Allow skaffold dev —watch image#925
Conversation
8c118c4 to
ca9502b
Compare
Codecov Report
@@ Coverage Diff @@
## master #925 +/- ##
=========================================
+ Coverage 43.28% 43.38% +0.1%
=========================================
Files 63 63
Lines 2629 2639 +10
=========================================
+ Hits 1138 1145 +7
- Misses 1372 1374 +2
- Partials 119 120 +1
Continue to review full report at Codecov.
|
ca9502b to
0e3bf24
Compare
skaffold dev —filter imageskaffold dev —watch image
0e3bf24 to
992f552
Compare
|
I’d recommend calling this —watch-image/-w to be verbose. Almost everyone has to read the help description to figure out how to use it otherwise. |
|
Thanks @ahmetb. I think I'll also add support for regexps |
|
What’s the use case do you have in mind with regexps? I suspect directories might work better than image names if multiple images (that can be selected via a regexp) are involved. |
|
I don't really have one in mind :-) In fact I tend to dislike regexps. You just convinced me to not bother and see if there's a need for it. |
992f552 to
f625378
Compare
balopat
left a comment
There was a problem hiding this comment.
Nits + would like to have a test please!
cmd/skaffold/app/cmd/cmd.go
Outdated
|
|
||
| func AddDevFlags(cmd *cobra.Command) { | ||
| cmd.Flags().BoolVar(&opts.Cleanup, "cleanup", true, "Delete deployments after dev mode is interrupted") | ||
| cmd.Flags().StringArrayVarP(&opts.Watch, "watch-image", "w", nil, "Choose which artifacts to watch. Matches against image names. Default is to watch sources for all artifacts.") |
There was a problem hiding this comment.
"Choose which artifacts to watch. Artifacts with image names that contain the expression will be watched only. Default is to watch sources for all artifacts."
pkg/skaffold/runner/runner.go
Outdated
| return true | ||
| } | ||
|
|
||
| for _, name := range r.opts.Watch { |
There was a problem hiding this comment.
nit: name -> watchExpression
Yeah I think there are two ways to go here. Either accept --watch-dir[] or --watch-image[]. I think --watch-image is good and I would not mind listing multiple images at once. Something like "interactive skaffold" came up in another issue (basically ability to stop building/watching certain images on the fly without turning skaffold off) but that's off-topic probably for now. |
Signed-off-by: David Gageot <david@gageot.net>
f625378 to
dd01d2a
Compare
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
|
ping @balopat |
The idea is to be able to run a dev loop that is focused on a few artifacts instead of all the artifacts. For eg, with the micro-services example, I could run
skaffold dev --watch-image appto only watch the code for theleeroy-apppart.Signed-off-by: David Gageot david@gageot.net