diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-04 09:46:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-04 09:46:24 -0500 |
commit | 87a78c059dc2fb72ba54805d5488f3e619ae46f1 (patch) | |
tree | a6c7ca6a504f71b1af2307fcdfbbae6787d73b6b /pkg/api/server/handler_api.go | |
parent | 17cacea3fa2bf0df20572720b9a0a3be35f2ef7b (diff) | |
parent | f86d64130838fbeb75ea2776a2f2b6c4a49e58b3 (diff) | |
download | podman-87a78c059dc2fb72ba54805d5488f3e619ae46f1.tar.gz podman-87a78c059dc2fb72ba54805d5488f3e619ae46f1.tar.bz2 podman-87a78c059dc2fb72ba54805d5488f3e619ae46f1.zip |
Merge pull request #9601 from jwhonce/issues/9207
Use version package to track all versions
Diffstat (limited to 'pkg/api/server/handler_api.go')
-rw-r--r-- | pkg/api/server/handler_api.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/api/server/handler_api.go b/pkg/api/server/handler_api.go index e7bf94fc6..28b8706a8 100644 --- a/pkg/api/server/handler_api.go +++ b/pkg/api/server/handler_api.go @@ -8,6 +8,7 @@ import ( "github.com/containers/podman/v3/pkg/api/handlers/utils" "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/version" "github.com/google/uuid" "github.com/sirupsen/logrus" ) @@ -55,10 +56,10 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc { c = context.WithValue(c, "idletracker", s.idleTracker) // nolint r = r.WithContext(c) - cv := utils.APIVersion[utils.CompatTree][utils.CurrentAPIVersion] + cv := version.APIVersion[version.Compat][version.CurrentAPI] w.Header().Set("API-Version", fmt.Sprintf("%d.%d", cv.Major, cv.Minor)) - lv := utils.APIVersion[utils.LibpodTree][utils.CurrentAPIVersion].String() + lv := version.APIVersion[version.Libpod][version.CurrentAPI].String() w.Header().Set("Libpod-API-Version", lv) w.Header().Set("Server", "Libpod/"+lv+" ("+runtime.GOOS+")") @@ -72,5 +73,5 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc { // VersionedPath prepends the version parsing code // any handler may override this default when registering URL(s) func VersionedPath(p string) string { - return "/v{version:[0-9][0-9.]*}" + p + return "/v{version:[0-9][0-9A-Za-z.-]*}" + p } |