Skip to content

Commit 1ac89ca

Browse files
committed
common: abort load on ENOSPEC and output clear error
Signed-off-by: Mark Zvenigorodsky <[email protected]>
1 parent cacf855 commit 1ac89ca

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

common/libimage/load.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"context"
77
"errors"
88
"fmt"
9+
"os"
10+
"syscall"
911
"time"
1012

1113
"github.com/sirupsen/logrus"
@@ -110,6 +112,14 @@ func (r *Runtime) Load(ctx context.Context, path string, options *LoadOptions) (
110112
return loadedImages, err
111113
}
112114
logrus.Debugf("Error loading %s (%s): %v", path, transportName, err)
115+
116+
var pathErr *os.PathError
117+
if errors.As(err, &pathErr) {
118+
if pathErr.Err == syscall.ENOSPC {
119+
return nil, pathErr
120+
}
121+
}
122+
113123
loadErrors = append(loadErrors, fmt.Errorf("%s: %v", transportName, err))
114124
}
115125

0 commit comments

Comments
 (0)