Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/cmd/container/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,11 @@ func RemoveContainer(ctx context.Context, c containerd.Container, globalOptions
hs, err := hostsstore.New(dataStore, containerNamespace)
if err != nil {
log.G(ctx).WithError(err).Warnf("failed to instantiate hostsstore for %q", containerNamespace)
} else if err = hs.Delete(id); err != nil {
} else if err = hs.Delete(id); err != nil && !errors.Is(err, store.ErrNotFound) {
// De-allocate hosts file - soft failure
// Some platforms and network modes never allocate a hosts file for the container in the first
// place (e.g. Windows containers), so ignore NotFound errors here, similarly to the
// nameStore.Release call above.
log.G(ctx).WithError(err).Warnf("failed to remove hosts file for container %q", id)
}

Expand Down
Loading