Add logs when listing files to be watched
Fixes
@@ -120,12 +120,21 @@ func (r *SkaffoldRunner) Dev(ctx context.Context, out io.Writer, artifacts []*la
defer r.forwarderManager.Stop()
// Watch artifacts
+ start := time.Now()
+ color.Default.Fprintln(out, "Listing files to watch...")
+
for i := range artifacts {
artifact := artifacts[i]
if !r.runCtx.Opts.IsTargetImage(artifact) {
continue
}
+ color.Default.Fprintf(out, " - %s\n", artifact.ImageName)
+
+ select {
+ case <-ctx.Done():
+ return context.Canceled
+ default:
if err := r.monitor.Register(
func() ([]string, error) { return r.builder.DependenciesForArtifact(ctx, artifact) },
func(e filemon.Events) {
@@ -144,6 +153,7 @@ func (r *SkaffoldRunner) Dev(ctx context.Context, out io.Writer, artifacts []*la
return errors.Wrapf(err, "watching files for artifact %s", artifact.ImageName)
}
}
+ }
// Watch test configuration
if err := r.monitor.Register(
@@ -169,6 +179,8 @@ func (r *SkaffoldRunner) Dev(ctx context.Context, out io.Writer, artifacts []*la
return errors.Wrapf(err, "watching skaffold configuration %s", r.runCtx.Opts.ConfigurationFile)
}
+ color.Default.Fprintln(out, "List generated in", time.Since(start))
+
// First build
if _, err := r.BuildAndTest(ctx, out, artifacts); err != nil {
return errors.Wrap(err, "exiting dev mode because first build failed")
