From 7ffe83dc954a015fb2ac8c618d2eee300fbff5fd Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 14 Jun 2023 15:21:15 +0200 Subject: [PATCH] don't apply "rebuild" watch strategy by default Signed-off-by: Nicolas De Loof --- pkg/compose/watch.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pkg/compose/watch.go b/pkg/compose/watch.go index 5c88382eb..2daefdd3d 100644 --- a/pkg/compose/watch.go +++ b/pkg/compose/watch.go @@ -104,7 +104,11 @@ func (s *composeService) Watch(ctx context.Context, project *types.Project, serv return err } - if config != nil && len(config.Watch) > 0 && service.Build == nil { + if config == nil { + continue + } + + if len(config.Watch) > 0 && service.Build == nil { // service configured with watchers but no build section return fmt.Errorf("can't watch service %q without a build context", service.Name) } @@ -118,17 +122,6 @@ func (s *composeService) Watch(ctx context.Context, project *types.Project, serv continue } - if config == nil { - config = &DevelopmentConfig{ - Watch: []Trigger{ - { - Path: service.Build.Context, - Action: WatchActionRebuild, - }, - }, - } - } - name := service.Name dockerIgnores, err := watch.LoadDockerIgnore(service.Build.Context) if err != nil {