Skip to content

Commit 17adc14

Browse files
committed
Migrate per-endpoint sysctls until 28.0.0
Commit 0071832 introduced per-endpoint sysctls, and migration to them from the top-level '--sysctl' option. The migration was intended to be short-term, disabled in the next major release and code was added to check for the next API version. But now, the API version will be bumped in a minor release - this breaking change needs to wait until the next major release, and we don't yet know the API version number for that. Signed-off-by: Rob Murray <[email protected]>
1 parent a43ed47 commit 17adc14

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

api/server/router/container/container_routes.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,12 +769,14 @@ func handleSysctlBC(
769769
netIfSysctl := fmt.Sprintf("net.%s.%s.IFNAME.%s=%s", spl[1], spl[2], spl[4], v)
770770
// Find the EndpointConfig to migrate settings to, if not already found.
771771
if ep == nil {
772+
/* TODO(robmry) - apply this to the API version used in 28.0.0
772773
// Per-endpoint sysctls were introduced in API version 1.46. Migration is
773774
// needed, but refuse to do it automatically for newer versions of the API.
774-
if versions.GreaterThan(version, "1.46") {
775+
if versions.GreaterThan(version, "1.??") {
775776
return "", fmt.Errorf("interface specific sysctl setting %q must be supplied using driver option '%s'",
776777
k, netlabel.EndpointSysctls)
777778
}
779+
*/
778780
var err error
779781
ep, err = epConfigForNetMode(version, hostConfig.NetworkMode, netConfig)
780782
if err != nil {

api/server/router/container/container_routes_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,17 @@ func TestHandleSysctlBC(t *testing.T) {
273273
"net.ipv6.conf.all.disable_ipv6": "0",
274274
},
275275
},
276+
/* TODO(robmry) - enable this test for the API version used in 28.0.0
276277
{
277278
name: "migration disabled for newer api",
278-
apiVersion: "1.47",
279+
apiVersion: "1.??",
279280
networkMode: "mynet",
280281
sysctls: map[string]string{
281282
"net.ipv6.conf.eth0.accept_ra": "2",
282283
},
283284
expError: "must be supplied using driver option 'com.docker.network.endpoint.sysctls'",
284285
},
286+
*/
285287
{
286288
name: "only migrate eth0",
287289
apiVersion: "1.46",

docs/api/version-history.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ keywords: "API, Docker, rcli, REST, documentation"
1717

1818
[Docker Engine API v1.47](https://docs.docker.com/engine/api/v1.47/) documentation
1919

20-
* `Sysctls` in `HostConfig` (top level `--sysctl` settings) for `eth0` are no
21-
longer migrated to `DriverOpts`, as described in the changes for v1.46.
2220
* `POST /networks/create` now has an `EnableIPv4` field. Setting it to `false`
2321
disables IPv4 IPAM for the network. It can only be set to `false` if the
2422
daemon has experimental features enabled.

0 commit comments

Comments
 (0)