Skip to content

Commit

Permalink
fix: Continue deployment even if ContainerRemove call returns error (#…
Browse files Browse the repository at this point in the history
…9561)

In some situations Podman will report that the previous container
is no longer present: "no container with ID or name ..."
This condition should not prevent redeployment to continue.

Fixes: #9560
  • Loading branch information
mnk authored Nov 15, 2024
1 parent 414ab98 commit df305b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/skaffold/docker/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func (l *localDaemon) Delete(ctx context.Context, out io.Writer, id string) erro
if err := l.apiClient.ContainerStop(ctx, id, container.StopOptions{}); err != nil {
log.Entry(ctx).Debugf("unable to stop running container: %s", err.Error())
}
if err := l.apiClient.ContainerRemove(ctx, id, types.ContainerRemoveOptions{}); err != nil {
return fmt.Errorf("removing stopped container: %w", err)
if err := l.apiClient.ContainerRemove(ctx, id, container.RemoveOptions{}); err != nil {
log.Entry(ctx).Warnf("unable to remove container: %s", err.Error())
}
_, err := l.apiClient.ContainersPrune(ctx, filters.Args{})
if err != nil {
Expand Down

0 comments on commit df305b3

Please sign in to comment.