Fix errcheck: error return value of `m.CleanupStagedLayer` is not checked

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
Jan Rodák 2024-07-08 13:49:39 +02:00
parent 5a9b3c1655
commit 4e1b4704d9
No known key found for this signature in database
GPG Key ID: E82E2FA0E160318E
1 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"github.com/containers/storage/pkg/ioutils"
"github.com/containers/storage/pkg/mflag"
digest "github.com/opencontainers/go-digest"
"github.com/sirupsen/logrus"
)
var (
@ -192,7 +193,9 @@ func applyDiffUsingStagingDirectory(flags *mflag.FlagSet, action string, m stora
DiffOptions: &options,
}
if _, err := m.ApplyStagedLayer(applyStagedLayerArgs); err != nil {
m.CleanupStagedLayer(out)
if err := m.CleanupStagedLayer(out); err != nil {
logrus.Warnf("cleanup of the staged layer failed: %v", err)
}
return 1, err
}
return 0, nil