mirror of https://github.com/containers/podman.git
Merge pull request #23321 from rhatdan/build
More information for podman --remote build and running out of space.
This commit is contained in:
commit
34d93d6502
|
@ -11,6 +11,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/containers/buildah"
|
"github.com/containers/buildah"
|
||||||
|
@ -33,6 +34,13 @@ import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func genSpaceErr(err error) error {
|
||||||
|
if errors.Is(err, syscall.ENOSPC) {
|
||||||
|
return fmt.Errorf("context directory may be too large: %w", err)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func BuildImage(w http.ResponseWriter, r *http.Request) {
|
func BuildImage(w http.ResponseWriter, r *http.Request) {
|
||||||
if hdr, found := r.Header["Content-Type"]; found && len(hdr) > 0 {
|
if hdr, found := r.Header["Content-Type"]; found && len(hdr) > 0 {
|
||||||
contentType := hdr[0]
|
contentType := hdr[0]
|
||||||
|
@ -73,7 +81,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
contextDirectory, err := extractTarFile(anchorDir, r)
|
contextDirectory, err := extractTarFile(anchorDir, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.InternalServerError(w, err)
|
utils.InternalServerError(w, genSpaceErr(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,7 +210,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
tempDir, subDir, err := buildahDefine.TempDirForURL(anchorDir, "buildah", query.Remote)
|
tempDir, subDir, err := buildahDefine.TempDirForURL(anchorDir, "buildah", query.Remote)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
utils.InternalServerError(w, err)
|
utils.InternalServerError(w, genSpaceErr(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if tempDir != "" {
|
if tempDir != "" {
|
||||||
|
|
Loading…
Reference in New Issue