podman
1package version
2
3import (
4"github.com/blang/semver/v4"
5"github.com/containers/podman/v5/version/rawversion"
6)
7
8type (
9// Tree determines which API endpoint tree for version
10Tree int
11// Level determines which API level, current or something from the past
12Level int
13)
14
15const (
16// Libpod supports Libpod endpoints
17Libpod = Tree(iota)
18// Compat supports Libpod endpoints
19Compat
20
21// CurrentAPI announces what is the current API level
22CurrentAPI = Level(iota)
23// MinimalAPI announces what is the oldest API level supported
24MinimalAPI
25)
26
27// Version is the version of the build.
28// NOTE: remember to bump the version at the top
29// of the top-level README.md file when this is
30// bumped.
31var Version = semver.MustParse(rawversion.RawVersion)
32
33// See https://docs.docker.com/engine/api/v1.40/
34// libpod compat handlers are expected to honor docker API versions
35
36// APIVersion provides the current and minimal API versions for compat and libpod endpoint trees
37// Note: GET|HEAD /_ping is never versioned and provides the API-Version and Libpod-API-Version headers to allow
38//
39// clients to shop for the Version they wish to support
40var APIVersion = map[Tree]map[Level]semver.Version{
41Libpod: {
42CurrentAPI: Version,
43MinimalAPI: semver.MustParse("4.0.0"),
44},
45Compat: {
46CurrentAPI: semver.MustParse("1.41.0"),
47MinimalAPI: semver.MustParse("1.24.0"),
48},
49}
50