Skip to content

Commit 341cf84

Browse files
committed
libimage: recommend podman system check over reset
podman system reset nukes everything which makes not a great suggestion. Now that we have the podman system check recommend that instead as it actually checks the storage for corruption and might be able to repair it. This is important because as it turns out this warning can pop up even in totally normal circumstances as there is a race between image and layer listing[1]. And even if that get fixed the check command will be the better suggestion. [1] containers/podman#23331 Signed-off-by: Paul Holzinger <[email protected]>
1 parent 860c6c1 commit 341cf84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libimage/layer_tree.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (r *Runtime) layerTree(ctx context.Context, images []*Image) (*layerTree, e
135135
// mistake. Users may not be able to recover, so we're now
136136
// throwing a warning to guide them to resolve the issue and
137137
// turn the errors non-fatal.
138-
logrus.Warnf("Top layer %s of image %s not found in layer tree. The storage may be corrupted, consider running `podman system reset`.", topLayer, img.ID())
138+
logrus.Warnf("Top layer %s of image %s not found in layer tree. The storage may be corrupted, consider running `podman system check`.", topLayer, img.ID())
139139
continue
140140
}
141141
node.images = append(node.images, img)
@@ -234,7 +234,7 @@ func (t *layerTree) children(ctx context.Context, parent *Image, all bool) ([]*I
234234
// mistake. Users may not be able to recover, so we're now
235235
// throwing a warning to guide them to resolve the issue and
236236
// turn the errors non-fatal.
237-
logrus.Warnf("Layer %s not found in layer tree. The storage may be corrupted, consider running `podman system reset`.", parent.TopLayer())
237+
logrus.Warnf("Layer %s not found in layer tree. The storage may be corrupted, consider running `podman system check`.", parent.TopLayer())
238238
return children, nil
239239
}
240240

@@ -336,7 +336,7 @@ func (t *layerTree) parent(ctx context.Context, child *Image) (*Image, error) {
336336
// mistake. Users may not be able to recover, so we're now
337337
// throwing a warning to guide them to resolve the issue and
338338
// turn the errors non-fatal.
339-
logrus.Warnf("Layer %s not found in layer tree. The storage may be corrupted, consider running `podman system reset`.", child.TopLayer())
339+
logrus.Warnf("Layer %s not found in layer tree. The storage may be corrupted, consider running `podman system check`.", child.TopLayer())
340340
return nil, nil
341341
}
342342

0 commit comments

Comments
 (0)