Skip to content

Commit ec88588

Browse files
ndeloofglours
authored andcommitted
Removed build warning when no explicit build has been requested.
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 7d59134 commit ec88588

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/compose/build.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ func (s *composeService) Build(ctx context.Context, project *types.Project, opti
4040
return Run(ctx, func(ctx context.Context) error {
4141
return tracing.SpanWrapFunc("project/build", tracing.ProjectOptions(ctx, project),
4242
func(ctx context.Context) error {
43-
_, err := s.build(ctx, project, options, nil)
43+
builtImages, err := s.build(ctx, project, options, nil)
44+
if err == nil && len(builtImages) == 0 {
45+
logrus.Warn("No services to build")
46+
}
4447
return err
4548
})(ctx)
4649
}, "build", s.events)
@@ -91,7 +94,6 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
9194
}
9295

9396
if len(serviceToBuild) == 0 {
94-
logrus.Warn("No services to build")
9597
return imageIDs, nil
9698
}
9799

0 commit comments

Comments
 (0)