@@ -98,7 +98,7 @@ func (s *composeService) ensureService(ctx context.Context, observedState Contai
98
98
}
99
99
100
100
for _ , container := range actual {
101
- name := getCanonicalContainerName (container )
101
+ name := getContainerProgressName (container )
102
102
103
103
diverged := container .Labels [configHashLabel ] != expected
104
104
if diverged || recreate == compose .RecreateForce || service .Extensions [extLifecycle ] == forceRecreate {
@@ -132,6 +132,10 @@ func getContainerName(projectName string, service types.ServiceConfig, number in
132
132
return name
133
133
}
134
134
135
+ func getContainerProgressName (container moby.Container ) string {
136
+ return "Container " + getCanonicalContainerName (container )
137
+ }
138
+
135
139
func (s * composeService ) waitDependencies (ctx context.Context , project * types.Project , service types.ServiceConfig ) error {
136
140
eg , _ := errgroup .WithContext (ctx )
137
141
for dep , config := range service .DependsOn {
@@ -191,18 +195,19 @@ func getScale(config types.ServiceConfig) (int, error) {
191
195
192
196
func (s * composeService ) createContainer (ctx context.Context , project * types.Project , service types.ServiceConfig , name string , number int , autoRemove bool ) error {
193
197
w := progress .ContextWriter (ctx )
194
- w .Event (progress .CreatingEvent (name ))
198
+ eventName := "Container " + name
199
+ w .Event (progress .CreatingEvent (eventName ))
195
200
err := s .createMobyContainer (ctx , project , service , name , number , nil , autoRemove )
196
201
if err != nil {
197
202
return err
198
203
}
199
- w .Event (progress .CreatedEvent (name ))
204
+ w .Event (progress .CreatedEvent (eventName ))
200
205
return nil
201
206
}
202
207
203
208
func (s * composeService ) recreateContainer (ctx context.Context , project * types.Project , service types.ServiceConfig , container moby.Container ) error {
204
209
w := progress .ContextWriter (ctx )
205
- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Working , "Recreate" ))
210
+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Working , "Recreate" ))
206
211
err := s .apiClient .ContainerStop (ctx , container .ID , nil )
207
212
if err != nil {
208
213
return err
@@ -225,7 +230,7 @@ func (s *composeService) recreateContainer(ctx context.Context, project *types.P
225
230
if err != nil {
226
231
return err
227
232
}
228
- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Done , "Recreated" ))
233
+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Done , "Recreated" ))
229
234
setDependentLifecycle (project , service .Name , forceRecreate )
230
235
return nil
231
236
}
@@ -245,12 +250,12 @@ func setDependentLifecycle(project *types.Project, service string, strategy stri
245
250
246
251
func (s * composeService ) restartContainer (ctx context.Context , container moby.Container ) error {
247
252
w := progress .ContextWriter (ctx )
248
- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Working , "Restart" ))
253
+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Working , "Restart" ))
249
254
err := s .apiClient .ContainerStart (ctx , container .ID , moby.ContainerStartOptions {})
250
255
if err != nil {
251
256
return err
252
257
}
253
- w .Event (progress .NewEvent (getCanonicalContainerName (container ), progress .Done , "Restarted" ))
258
+ w .Event (progress .NewEvent (getContainerProgressName (container ), progress .Done , "Restarted" ))
254
259
return nil
255
260
}
256
261
@@ -336,10 +341,11 @@ func (s *composeService) startService(ctx context.Context, project *types.Projec
336
341
}
337
342
eg .Go (func () error {
338
343
w := progress .ContextWriter (ctx )
339
- w .Event (progress .StartingEvent (getCanonicalContainerName (container )))
344
+ eventName := getContainerProgressName (container )
345
+ w .Event (progress .StartingEvent (eventName ))
340
346
err := s .apiClient .ContainerStart (ctx , container .ID , moby.ContainerStartOptions {})
341
347
if err == nil {
342
- w .Event (progress .StartedEvent (getCanonicalContainerName ( container ) ))
348
+ w .Event (progress .StartedEvent (eventName ))
343
349
}
344
350
return err
345
351
})
0 commit comments