mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Merge pull request #51186 from thaJeztah/deprecate_api_v1.43
daemon: raise default minimum API version to v1.44
This commit is contained in:
5
.github/workflows/.windows.yml
vendored
5
.github/workflows/.windows.yml
vendored
@@ -344,8 +344,11 @@ jobs:
|
|||||||
"--register-service"
|
"--register-service"
|
||||||
If ("${{ inputs.storage }}" -eq "graphdriver") {
|
If ("${{ inputs.storage }}" -eq "graphdriver") {
|
||||||
# Make the env-var visible to the service-managed dockerd, as there's no CLI flag for this option.
|
# Make the env-var visible to the service-managed dockerd, as there's no CLI flag for this option.
|
||||||
& reg add "HKLM\SYSTEM\CurrentControlSet\Services\docker" /v Environment /t REG_MULTI_SZ /s '@' /d TEST_INTEGRATION_USE_GRAPHDRIVER=1
|
& reg add "HKLM\SYSTEM\CurrentControlSet\Services\docker" /v Environment /t REG_MULTI_SZ /s '@' /d "DOCKER_MIN_API_VERSION=1.24@TEST_INTEGRATION_USE_GRAPHDRIVER=1"
|
||||||
echo "TEST_INTEGRATION_USE_GRAPHDRIVER=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
echo "TEST_INTEGRATION_USE_GRAPHDRIVER=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
|
||||||
|
} Else {
|
||||||
|
# Make the env-var visible to the service-managed dockerd, as there's no CLI flag for this option.
|
||||||
|
& reg add "HKLM\SYSTEM\CurrentControlSet\Services\docker" /v Environment /t REG_MULTI_SZ /s '@' /d DOCKER_MIN_API_VERSION=1.24
|
||||||
}
|
}
|
||||||
Write-Host "Starting service"
|
Write-Host "Starting service"
|
||||||
Start-Service -Name docker
|
Start-Service -Name docker
|
||||||
|
|||||||
@@ -59,10 +59,12 @@ const (
|
|||||||
//
|
//
|
||||||
// This version may be lower than the version of the api library module used.
|
// This version may be lower than the version of the api library module used.
|
||||||
MaxAPIVersion = "1.52"
|
MaxAPIVersion = "1.52"
|
||||||
// MinAPIVersion is the minimum API version supported by the API.
|
// defaultMinAPIVersion is the minimum API version supported by the API.
|
||||||
// This version can be overridden through the "DOCKER_MIN_API_VERSION"
|
// This version can be overridden through the "DOCKER_MIN_API_VERSION"
|
||||||
// environment variable. It currently defaults to the minimum API version
|
// environment variable. The minimum allowed version is determined
|
||||||
// implemented in the API module.
|
// by [MinAPIVersion].
|
||||||
|
defaultMinAPIVersion = "1.44"
|
||||||
|
// MinAPIVersion is the minimum API version supported by the daemon.
|
||||||
MinAPIVersion = "1.24"
|
MinAPIVersion = "1.24"
|
||||||
// SeccompProfileDefault is the built-in default seccomp profile.
|
// SeccompProfileDefault is the built-in default seccomp profile.
|
||||||
SeccompProfileDefault = "builtin"
|
SeccompProfileDefault = "builtin"
|
||||||
@@ -347,7 +349,7 @@ func New() (*Config, error) {
|
|||||||
ContainerdPluginNamespace: DefaultPluginNamespace,
|
ContainerdPluginNamespace: DefaultPluginNamespace,
|
||||||
Features: make(map[string]bool),
|
Features: make(map[string]bool),
|
||||||
DefaultRuntime: StockRuntimeName,
|
DefaultRuntime: StockRuntimeName,
|
||||||
MinAPIVersion: MinAPIVersion,
|
MinAPIVersion: defaultMinAPIVersion,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ exec 41>&1 42>&2
|
|||||||
export DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-native}
|
export DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-native}
|
||||||
export DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true}
|
export DOCKER_USERLANDPROXY=${DOCKER_USERLANDPROXY:-true}
|
||||||
|
|
||||||
|
# Allow testing old API versions
|
||||||
|
export DOCKER_MIN_API_VERSION=1.24
|
||||||
|
|
||||||
# example usage: DOCKER_STORAGE_OPTS="dm.basesize=20G,dm.loopdatasize=200G"
|
# example usage: DOCKER_STORAGE_OPTS="dm.basesize=20G,dm.loopdatasize=200G"
|
||||||
storage_params=""
|
storage_params=""
|
||||||
if [ -n "$DOCKER_STORAGE_OPTS" ]; then
|
if [ -n "$DOCKER_STORAGE_OPTS" ]; then
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ type Daemon struct {
|
|||||||
// The daemon will not automatically start.
|
// The daemon will not automatically start.
|
||||||
func New(t testing.TB, dockerBinary string, dockerdBinary string, ops ...daemon.Option) *Daemon {
|
func New(t testing.TB, dockerBinary string, dockerdBinary string, ops ...daemon.Option) *Daemon {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
ops = append(ops, daemon.WithDockerdBinary(dockerdBinary))
|
ops = append(ops, daemon.WithDockerdBinary(dockerdBinary), daemon.WithEnvVars("DOCKER_MIN_API_VERSION=1.24"))
|
||||||
d := daemon.New(t, ops...)
|
d := daemon.New(t, ops...)
|
||||||
return &Daemon{
|
return &Daemon{
|
||||||
Daemon: d,
|
Daemon: d,
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ func TestCgroupNamespacesRunOlderClient(t *testing.T) {
|
|||||||
|
|
||||||
ctx := testutil.StartSpan(baseContext, t)
|
ctx := testutil.StartSpan(baseContext, t)
|
||||||
|
|
||||||
d := daemon.New(t, daemon.WithDefaultCgroupNamespaceMode("private"))
|
d := daemon.New(t, daemon.WithEnvVars("DOCKER_MIN_API_VERSION=1.39"), daemon.WithDefaultCgroupNamespaceMode("private"))
|
||||||
apiClient := d.NewClientT(t, client.WithVersion("1.39"))
|
apiClient := d.NewClientT(t, client.WithVersion("1.39"))
|
||||||
|
|
||||||
d.StartWithBusybox(ctx, t)
|
d.StartWithBusybox(ctx, t)
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp/cmpopts"
|
"github.com/google/go-cmp/cmp/cmpopts"
|
||||||
"github.com/moby/moby/api/types/image"
|
"github.com/moby/moby/api/types/image"
|
||||||
"github.com/moby/moby/api/types/versions"
|
|
||||||
"github.com/moby/moby/client"
|
"github.com/moby/moby/client"
|
||||||
"github.com/moby/moby/v2/daemon/config"
|
|
||||||
"github.com/moby/moby/v2/integration/internal/container"
|
"github.com/moby/moby/v2/integration/internal/container"
|
||||||
iimage "github.com/moby/moby/v2/integration/internal/image"
|
iimage "github.com/moby/moby/v2/integration/internal/image"
|
||||||
"github.com/moby/moby/v2/internal/testutil"
|
"github.com/moby/moby/v2/internal/testutil"
|
||||||
@@ -255,7 +253,7 @@ func TestAPIImagesListManifests(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("unsupported before 1.47", func(t *testing.T) {
|
t.Run("unsupported before 1.47", func(t *testing.T) {
|
||||||
// TODO: Remove when MinAPIVersion >= 1.47
|
// TODO: Remove when MinAPIVersion >= 1.47
|
||||||
c := d.NewClientT(t, client.WithVersion(config.MinAPIVersion))
|
c := d.NewClientT(t, client.WithVersion("1.46"))
|
||||||
|
|
||||||
images, err := c.ImageList(ctx, client.ImageListOptions{Manifests: true})
|
images, err := c.ImageList(ctx, client.ImageListOptions{Manifests: true})
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
@@ -264,8 +262,6 @@ func TestAPIImagesListManifests(t *testing.T) {
|
|||||||
assert.Check(t, is.Nil(images[0].Manifests))
|
assert.Check(t, is.Nil(images[0].Manifests))
|
||||||
})
|
})
|
||||||
|
|
||||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.47"))
|
|
||||||
|
|
||||||
api147 := d.NewClientT(t, client.WithVersion("1.47"))
|
api147 := d.NewClientT(t, client.WithVersion("1.47"))
|
||||||
|
|
||||||
t.Run("no manifests if not requested", func(t *testing.T) {
|
t.Run("no manifests if not requested", func(t *testing.T) {
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ func TestInspectCfgdMAC(t *testing.T) {
|
|||||||
|
|
||||||
ctx := setupTest(t)
|
ctx := setupTest(t)
|
||||||
|
|
||||||
d := daemon.New(t)
|
d := daemon.New(t, daemon.WithEnvVars("DOCKER_MIN_API_VERSION=1.43"))
|
||||||
d.StartWithBusybox(ctx, t)
|
d.StartWithBusybox(ctx, t)
|
||||||
defer d.Stop(t)
|
defer d.Stop(t)
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ func TestWatchtowerCreate(t *testing.T) {
|
|||||||
|
|
||||||
ctx := setupTest(t)
|
ctx := setupTest(t)
|
||||||
|
|
||||||
d := daemon.New(t)
|
d := daemon.New(t, daemon.WithEnvVars("DOCKER_MIN_API_VERSION=1.25"))
|
||||||
d.StartWithBusybox(ctx, t)
|
d.StartWithBusybox(ctx, t)
|
||||||
defer d.Stop(t)
|
defer d.Stop(t)
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import (
|
|||||||
func TestDockerNetworkConnectAliasPreV144(t *testing.T) {
|
func TestDockerNetworkConnectAliasPreV144(t *testing.T) {
|
||||||
ctx := setupTest(t)
|
ctx := setupTest(t)
|
||||||
|
|
||||||
d := swarm.NewSwarm(ctx, t, testEnv)
|
d := swarm.NewSwarm(ctx, t, testEnv, daemon.WithEnvVars("DOCKER_MIN_API_VERSION=1.43"))
|
||||||
defer d.Stop(t)
|
defer d.Stop(t)
|
||||||
apiClient := d.NewClientT(t, client.WithVersion("1.43"))
|
apiClient := d.NewClientT(t, client.WithVersion("1.43"))
|
||||||
defer apiClient.Close()
|
defer apiClient.Close()
|
||||||
|
|||||||
Reference in New Issue
Block a user