Bläddra i källkod

don't apply "rebuild" watch strategy by default

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 2 år sedan
förälder
incheckning
7ffe83dc95
1 ändrade filer med 5 tillägg och 12 borttagningar
  1. 5 12
      pkg/compose/watch.go

+ 5 - 12
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 {