@@ -98,7 +98,7 @@ func (s *composeService) ensureService(ctx context.Context, observedState Contai
9898 }
9999
100100 for _ , container := range actual {
101- name := getCanonicalContainerName (container )
101+ name := getContainerProgressName (container )
102102
103103 diverged := container .Labels [configHashLabel ] != expected
104104 if diverged || recreate == compose .RecreateForce || service .Extensions [extLifecycle ] == forceRecreate {
@@ -132,6 +132,10 @@ func getContainerName(projectName string, service types.ServiceConfig, number in
132132 return name
133133}
134134
135+ func getContainerProgressName (container moby.Container ) string {
136+ return "Container " + getCanonicalContainerName (container )
137+ }
138+
135139func (s * composeService ) waitDependencies (ctx context.Context , project * types.Project , service types.ServiceConfig ) error {
136140 eg , _ := errgroup .WithContext (ctx )
137141 for dep , config := range service .DependsOn {
@@ -191,18 +195,19 @@ func getScale(config types.ServiceConfig) (int, error) {
191195
192196func (s * composeService ) createContainer (ctx context.Context , project * types.Project , service types.ServiceConfig , name string , number int , autoRemove bool ) error {
193197 w := progress .ContextWriter (ctx )
194- w .Event (progress .CreatingEvent (name ))
198+ eventName := "Container " + name
199+ w .Event (progress .CreatingEvent (eventName ))
195200 err := s .createMobyContainer (ctx , project , service , name , number , nil , autoRemove )
196201 if err != nil {
197202 return err
198203 }
199- w .Event (progress .CreatedEvent (name ))
204+ w .Event (progress .CreatedEvent (eventName ))
200205 return nil
201206}
202207
203208func (s * composeService ) recreateContainer (ctx context.Context , project * types.Project , service types.ServiceConfig , container moby.Container ) error {
204209 w := progress .ContextWriter (ctx )
205- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Working , "Recreate" ))
210+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Working , "Recreate" ))
206211 err := s .apiClient .ContainerStop (ctx , container .ID , nil )
207212 if err != nil {
208213 return err
@@ -225,7 +230,7 @@ func (s *composeService) recreateContainer(ctx context.Context, project *types.P
225230 if err != nil {
226231 return err
227232 }
228- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Done , "Recreated" ))
233+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Done , "Recreated" ))
229234 setDependentLifecycle (project , service .Name , forceRecreate )
230235 return nil
231236}
@@ -245,12 +250,12 @@ func setDependentLifecycle(project *types.Project, service string, strategy stri
245250
246251func (s * composeService ) restartContainer (ctx context.Context , container moby.Container ) error {
247252 w := progress .ContextWriter (ctx )
248- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Working , "Restart" ))
253+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Working , "Restart" ))
249254 err := s .apiClient .ContainerStart (ctx , container .ID , moby.ContainerStartOptions {})
250255 if err != nil {
251256 return err
252257 }
253- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Done , "Restarted" ))
258+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Done , "Restarted" ))
254259 return nil
255260}
256261
@@ -336,10 +341,11 @@ func (s *composeService) startService(ctx context.Context, project *types.Projec
336341 }
337342 eg .Go (func () error {
338343 w := progress .ContextWriter (ctx )
339- w .Event (progress .StartingEvent (getCanonicalContainerName (container )))
344+ eventName := getContainerProgressName (container )
345+ w .Event (progress .StartingEvent (eventName ))
340346 err := s .apiClient .ContainerStart (ctx , container .ID , moby.ContainerStartOptions {})
341347 if err == nil {
342- w .Event (progress .StartedEvent (getCanonicalContainerName ( container ) ))
348+ w .Event (progress .StartedEvent (eventName ))
343349 }
344350 return err
345351 })
0 commit comments