summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-29 13:41:42 +0000
committerGitHub <noreply@github.com>2021-03-29 13:41:42 +0000
commitac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad (patch)
tree401c7ddec178185b6af4dc782bfbba4d20673e06 /pkg/api/handlers
parent259004f0a9cc18018127baec0bfcf8bc091dabb6 (diff)
parent4d5199537737b0cfef47d3d2700013a787126d21 (diff)
downloadpodman-ac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad.tar.gz
podman-ac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad.tar.bz2
podman-ac3499cc9605dd2c7bfccedd6f9a95c7bc0dd9ad.zip
Merge pull request #9631 from rhatdan/pull
Fix podman build --pull-never
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/compat/images_build.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index 15ba5c685..36785a362 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -13,6 +13,7 @@ import (
"time"
"github.com/containers/buildah"
+ "github.com/containers/buildah/define"
"github.com/containers/buildah/imagebuildah"
"github.com/containers/buildah/util"
"github.com/containers/image/v5/types"
@@ -98,6 +99,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
OutputFormat string `schema:"outputformat"`
Platform string `schema:"platform"`
Pull bool `schema:"pull"`
+ PullPolicy string `schema:"pullpolicy"`
Quiet bool `schema:"q"`
Registry string `schema:"registry"`
Rm bool `schema:"rm"`
@@ -275,10 +277,14 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
jobs = query.Jobs
}
- pullPolicy := buildah.PullIfMissing
- if _, found := r.URL.Query()["pull"]; found {
- if query.Pull {
- pullPolicy = buildah.PullAlways
+ pullPolicy := define.PullIfMissing
+ if utils.IsLibpodRequest(r) {
+ pullPolicy = define.PolicyMap[query.PullPolicy]
+ } else {
+ if _, found := r.URL.Query()["pull"]; found {
+ if query.Pull {
+ pullPolicy = define.PullAlways
+ }
}
}