Skip to content

Commit

Permalink
Relax error on annotations read failure
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Dec 16, 2024
1 parent 7e97f06 commit adfa176
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cmd/container/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ func cleanupNetwork(ctx context.Context, container containerd.Container, globalO
networksJSON := spec.Annotations[labels.Networks]
var networks []string
if err := json.Unmarshal([]byte(networksJSON), &networks); err != nil {
return err
log.G(ctx).WithError(err).Warnf("Unable to read network annotation: this container was probably not started with nerdctl." +
"No networking cleanup will be performed, which may likely result in a broken state for the other systems you used to manage these containers." +
"Mixing completely different stacks to manage containers lifecycle is not recommended.")
return nil
}
netType, err := nettype.Detect(networks)
if err != nil {
Expand Down

0 comments on commit adfa176

Please sign in to comment.