Skip to content

Commit

Permalink
From 28.0.0, don't migrate per-endpoint sysctls.
Browse files Browse the repository at this point in the history
Re-add checks that were removed until 28.0.0's API version was
known, in commit 17adc14

Signed-off-by: Rob Murray <[email protected]>
  • Loading branch information
robmry committed Oct 24, 2024
1 parent 87365d9 commit 533e7d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions api/server/router/container/container_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,14 +769,12 @@ 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.??") {
// needed, but refuse to do it automatically for API 1.48 and newer.
if versions.GreaterThan(version, "1.47") {
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 {
Expand Down
4 changes: 1 addition & 3 deletions api/server/router/container/container_routes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,15 @@ 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.??",
apiVersion: "1.48",
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",
Expand Down
2 changes: 2 additions & 0 deletions docs/api/version-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ keywords: "API, Docker, rcli, REST, documentation"
* Deprecated: The `ContainerdCommit.Expected`, `RuncCommit.Expected`, and
`InitCommit.Expected` fields in the `GET /info` endpoint are deprecated
and will be omitted in API v1.49.
* `Sysctls` in `HostConfig` (top level `--sysctl` settings) for `eth0` are
no longer migrated to `DriverOpts`, as described in the changes for v1.46.

## v1.47 API changes

Expand Down

0 comments on commit 533e7d1

Please sign in to comment.