summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-03-02 14:25:29 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-03-02 14:25:29 -0500
commit5df6251402af9cc38172edb7802374fcf787d920 (patch)
tree779860725a73f4fbe19a48aadb96070be3b40114 /pkg/api/handlers
parent426178a49991106ffe222f12cc42409ae78dd257 (diff)
downloadpodman-5df6251402af9cc38172edb7802374fcf787d920.tar.gz
podman-5df6251402af9cc38172edb7802374fcf787d920.tar.bz2
podman-5df6251402af9cc38172edb7802374fcf787d920.zip
Fix support for podman build --timestamp
Currently podman is ignoreing the build --timestamp flag. This PR fixes this for local and remote clients. Fixes: https://github.com/containers/podman/issues/9569 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/compat/images_build.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index d79b100e8..009fcf7e8 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -104,6 +104,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Squash bool `schema:"squash"`
Tag []string `schema:"t"`
Target string `schema:"target"`
+ Timestamp int64 `schema:"timestamp"`
}{
Dockerfile: "Dockerfile",
Registry: "docker.io",
@@ -318,6 +319,11 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Target: query.Target,
}
+ if _, found := r.URL.Query()["timestamp"]; found {
+ ts := time.Unix(query.Timestamp, 0)
+ buildOptions.Timestamp = &ts
+ }
+
runCtx, cancel := context.WithCancel(context.Background())
var imageID string
go func() {