summaryrefslogtreecommitdiff
path: root/pkg/api/server
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2021-03-03 10:47:02 -0700
committerJhon Honce <jhonce@redhat.com>2021-03-03 17:03:19 -0700
commitf86d64130838fbeb75ea2776a2f2b6c4a49e58b3 (patch)
tree232fa1410600b9ed11f66d81d6d13f97e16c35c4 /pkg/api/server
parent87e20560ac885c541784af1341098ce8e1e7a940 (diff)
downloadpodman-f86d64130838fbeb75ea2776a2f2b6c4a49e58b3.tar.gz
podman-f86d64130838fbeb75ea2776a2f2b6c4a49e58b3.tar.bz2
podman-f86d64130838fbeb75ea2776a2f2b6c4a49e58b3.zip
Use version package to track all versions
* Server, bindings, and CLI all now pull version information from version package. * Current /libpod API version slaved to podman/libpod Version * Bindings validate against libpod API Minimal version * Remove pkg/bindings/bindings.go and updated tests Fixes: #9207 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/api/server')
-rw-r--r--pkg/api/server/handler_api.go7
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
}