@@ -23,7 +23,7 @@ import (
2323 "time"
2424
2525 "github.com/compose-spec/compose-go/v2/types"
26- cerrdefs "github.com/containerd/errdefs"
26+ "github.com/containerd/errdefs"
2727 "github.com/docker/compose/v2/pkg/api"
2828 "github.com/docker/compose/v2/pkg/progress"
2929 "github.com/docker/compose/v2/pkg/utils"
@@ -219,7 +219,7 @@ func (s *composeService) removeNetwork(ctx context.Context, composeNetworkName s
219219 continue
220220 }
221221 nw , err := s .apiClient ().NetworkInspect (ctx , net .ID , network.InspectOptions {})
222- if cerrdefs .IsNotFound (err ) {
222+ if errdefs .IsNotFound (err ) {
223223 w .Event (progress .NewEvent (eventName , progress .Warning , "No resource found to remove" ))
224224 return nil
225225 }
@@ -233,7 +233,7 @@ func (s *composeService) removeNetwork(ctx context.Context, composeNetworkName s
233233 }
234234
235235 if err := s .apiClient ().NetworkRemove (ctx , net .ID ); err != nil {
236- if cerrdefs .IsNotFound (err ) {
236+ if errdefs .IsNotFound (err ) {
237237 continue
238238 }
239239 w .Event (progress .ErrorEvent (eventName ))
@@ -261,11 +261,11 @@ func (s *composeService) removeImage(ctx context.Context, image string, w progre
261261 w .Event (progress .NewEvent (id , progress .Done , "Removed" ))
262262 return nil
263263 }
264- if cerrdefs .IsConflict (err ) {
264+ if errdefs .IsConflict (err ) {
265265 w .Event (progress .NewEvent (id , progress .Warning , "Resource is still in use" ))
266266 return nil
267267 }
268- if cerrdefs .IsNotFound (err ) {
268+ if errdefs .IsNotFound (err ) {
269269 w .Event (progress .NewEvent (id , progress .Done , "Warning: No resource found to remove" ))
270270 return nil
271271 }
@@ -276,7 +276,7 @@ func (s *composeService) removeVolume(ctx context.Context, id string, w progress
276276 resource := fmt .Sprintf ("Volume %s" , id )
277277
278278 _ , err := s .apiClient ().VolumeInspect (ctx , id )
279- if cerrdefs .IsNotFound (err ) {
279+ if errdefs .IsNotFound (err ) {
280280 // Already gone
281281 return nil
282282 }
@@ -287,11 +287,11 @@ func (s *composeService) removeVolume(ctx context.Context, id string, w progress
287287 w .Event (progress .NewEvent (resource , progress .Done , "Removed" ))
288288 return nil
289289 }
290- if cerrdefs .IsConflict (err ) {
290+ if errdefs .IsConflict (err ) {
291291 w .Event (progress .NewEvent (resource , progress .Warning , "Resource is still in use" ))
292292 return nil
293293 }
294- if cerrdefs .IsNotFound (err ) {
294+ if errdefs .IsNotFound (err ) {
295295 w .Event (progress .NewEvent (resource , progress .Done , "Warning: No resource found to remove" ))
296296 return nil
297297 }
@@ -311,7 +311,7 @@ func (s *composeService) stopContainer(
311311 err := s .runHook (ctx , ctr , * service , hook , listener )
312312 if err != nil {
313313 // Ignore errors indicating that some containers were already stopped or removed.
314- if cerrdefs .IsNotFound (err ) || cerrdefs .IsConflict (err ) {
314+ if errdefs .IsNotFound (err ) || errdefs .IsConflict (err ) {
315315 return nil
316316 }
317317 return err
@@ -357,7 +357,7 @@ func (s *composeService) stopAndRemoveContainer(ctx context.Context, ctr contain
357357 w := progress .ContextWriter (ctx )
358358 eventName := getContainerProgressName (ctr )
359359 err := s .stopContainer (ctx , w , service , ctr , timeout , nil )
360- if cerrdefs .IsNotFound (err ) {
360+ if errdefs .IsNotFound (err ) {
361361 w .Event (progress .RemovedEvent (eventName ))
362362 return nil
363363 }
@@ -369,7 +369,7 @@ func (s *composeService) stopAndRemoveContainer(ctx context.Context, ctr contain
369369 Force : true ,
370370 RemoveVolumes : volumes ,
371371 })
372- if err != nil && ! cerrdefs .IsNotFound (err ) && ! cerrdefs .IsConflict (err ) {
372+ if err != nil && ! errdefs .IsNotFound (err ) && ! errdefs .IsConflict (err ) {
373373 w .Event (progress .ErrorMessageEvent (eventName , "Error while Removing" ))
374374 return err
375375 }
0 commit comments