Warn if we are deleting an incomplete layer

... to help diagnosing later possible broken references
to this layer; compare https://github.com/containers/storage/issues/1136 .

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2022-02-22 00:07:20 +01:00
parent c7b594436b
commit e50e11c88c
1 changed files with 1 additions and 0 deletions

View File

@ -400,6 +400,7 @@ func (r *layerStore) Load() error {
layer.Flags = make(map[string]interface{})
}
if layerHasIncompleteFlag(layer) {
logrus.Warnf("Found incomplete layer %#v, deleting it", layer.ID)
err = r.deleteInternal(layer.ID)
if err != nil {
break