diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-09-15 11:29:45 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-09-15 11:29:45 -0700 |
commit | 8a8bae8299dff8d10c0a2f5873190e19a83ea01c (patch) | |
tree | c3ceb3bdb851ef3713529b0fc6a989883bd2acf5 /pkg/api/handlers/compat/ping.go | |
parent | 0be5836e49da38b156951639b7e19eaec6a6e593 (diff) | |
download | podman-8a8bae8299dff8d10c0a2f5873190e19a83ea01c.tar.gz podman-8a8bae8299dff8d10c0a2f5873190e19a83ea01c.tar.bz2 podman-8a8bae8299dff8d10c0a2f5873190e19a83ea01c.zip |
Refactor API version values
* API-Version header now Major.Minor to support tools parsing this
header
* Libpod Version updated to 2.0.0 to reflect changes in API field
values
* API-Version and Libpod-API-Version headers are now included in all
results
Fixes #7327
* Header support tested against goland 2020.2 and
https://www.jetbrains.com/help/idea/docker.html plugin
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat/ping.go')
-rw-r--r-- | pkg/api/handlers/compat/ping.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/ping.go b/pkg/api/handlers/compat/ping.go index eb7eed5b6..06150bb63 100644 --- a/pkg/api/handlers/compat/ping.go +++ b/pkg/api/handlers/compat/ping.go @@ -5,7 +5,6 @@ import ( "net/http" "github.com/containers/buildah" - "github.com/containers/podman/v2/pkg/api/handlers/utils" ) // Ping returns headers to client about the service @@ -14,13 +13,12 @@ import ( // Clients will use the Header availability to test which backend engine is in use. // Note: Additionally handler supports GET and HEAD methods func Ping(w http.ResponseWriter, r *http.Request) { - w.Header().Set("API-Version", utils.APIVersion[utils.CompatTree][utils.CurrentAPIVersion].String()) + // Note API-Version and Libpod-API-Version are set in handler_api.go w.Header().Set("BuildKit-Version", "") w.Header().Set("Docker-Experimental", "true") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Pragma", "no-cache") - w.Header().Set("Libpod-API-Version", utils.APIVersion[utils.LibpodTree][utils.CurrentAPIVersion].String()) w.Header().Set("Libpod-Buildha-Version", buildah.Version) w.WriteHeader(http.StatusOK) |