Skip to content

Commit df305b3

Browse files
authored
fix: Continue deployment even if ContainerRemove call returns error (#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
1 parent 414ab98 commit df305b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/skaffold/docker/image.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ func (l *localDaemon) Delete(ctx context.Context, out io.Writer, id string) erro
208208
if err := l.apiClient.ContainerStop(ctx, id, container.StopOptions{}); err != nil {
209209
log.Entry(ctx).Debugf("unable to stop running container: %s", err.Error())
210210
}
211-
if err := l.apiClient.ContainerRemove(ctx, id, types.ContainerRemoveOptions{}); err != nil {
212-
return fmt.Errorf("removing stopped container: %w", err)
211+
if err := l.apiClient.ContainerRemove(ctx, id, container.RemoveOptions{}); err != nil {
212+
log.Entry(ctx).Warnf("unable to remove container: %s", err.Error())
213213
}
214214
_, err := l.apiClient.ContainersPrune(ctx, filters.Args{})
215215
if err != nil {

0 commit comments

Comments
 (0)