Merge pull request #48281 from robmry/remove_sysctl_migration_limit

Migrate per-endpoint sysctls until 28.0.0
This commit is contained in:
Rob Murray
2024-08-06 18:11:00 +01:00
committed by GitHub
3 changed files with 7 additions and 5 deletions

View File

@@ -769,12 +769,14 @@ func handleSysctlBC(
netIfSysctl := fmt.Sprintf("net.%s.%s.IFNAME.%s=%s", spl[1], spl[2], spl[4], v)
// Find the EndpointConfig to migrate settings to, if not already found.
if ep == nil {
/* TODO(robmry) - apply this to the API version used in 28.0.0
// Per-endpoint sysctls were introduced in API version 1.46. Migration is
// needed, but refuse to do it automatically for newer versions of the API.
if versions.GreaterThan(version, "1.46") {
if versions.GreaterThan(version, "1.??") {
return "", fmt.Errorf("interface specific sysctl setting %q must be supplied using driver option '%s'",
k, netlabel.EndpointSysctls)
}
*/
var err error
ep, err = epConfigForNetMode(version, hostConfig.NetworkMode, netConfig)
if err != nil {

View File

@@ -273,15 +273,17 @@ func TestHandleSysctlBC(t *testing.T) {
"net.ipv6.conf.all.disable_ipv6": "0",
},
},
/* TODO(robmry) - enable this test for the API version used in 28.0.0
{
name: "migration disabled for newer api",
apiVersion: "1.47",
apiVersion: "1.??",
networkMode: "mynet",
sysctls: map[string]string{
"net.ipv6.conf.eth0.accept_ra": "2",
},
expError: "must be supplied using driver option 'com.docker.network.endpoint.sysctls'",
},
*/
{
name: "only migrate eth0",
apiVersion: "1.46",

View File

@@ -17,8 +17,6 @@ keywords: "API, Docker, rcli, REST, documentation"
[Docker Engine API v1.47](https://docs.docker.com/engine/api/v1.47/) documentation
* `Sysctls` in `HostConfig` (top level `--sysctl` settings) for `eth0` are no
longer migrated to `DriverOpts`, as described in the changes for v1.46.
* `POST /networks/create` now has an `EnableIPv4` field. Setting it to `false`
disables IPv4 IPAM for the network. It can only be set to `false` if the
daemon has experimental features enabled.
@@ -40,7 +38,7 @@ keywords: "API, Docker, rcli, REST, documentation"
`net.ipv4.config.eth0.log_martians=1`, use
`net.ipv4.config.IFNAME.log_martians=1`. In API versions up-to 1.46, top level
`--sysctl` settings for `eth0` will be migrated to `DriverOpts` when possible.
This automatic migration will be removed for API versions 1.47 and greater.
This automatic migration will be removed in a future release.
* `GET /containers/json` now returns the annotations of containers.
* `POST /images/{name}/push` now supports a `platform` parameter (JSON encoded
OCI Platform type) that allows selecting a specific platform manifest from