Update linter for golang v1.25 compatibility

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2026-03-10 19:55:51 -06:00
committed by Christian Goll
parent 019408d076
commit 081d2ec61e
48 changed files with 156 additions and 115 deletions

View File

@@ -20,6 +20,7 @@ import (
"github.com/opencontainers/umoci"
"github.com/opencontainers/umoci/oci/layer"
"github.com/warewulf/warewulf/internal/pkg/util"
"github.com/warewulf/warewulf/internal/pkg/wwlog"
)
type pullerOpt func(*puller) error
@@ -140,7 +141,11 @@ func (p *puller) Pull(ctx context.Context, uri, dst string) (err error) {
if err != nil {
return err
}
defer os.RemoveAll(tmpDir)
defer func() {
if err := os.RemoveAll(tmpDir); err != nil {
wwlog.Warn("failed to remove temporary directory %s: %s", tmpDir, err)
}
}()
// create an oci bundle our tmpdir to avoid issues with umoci.UnpackRootfs()
tmpRef, err := layout.ParseReference(tmpDir + ":" + "tmp")