Skip to content

Commit 40715ad

Browse files
authored
Merge pull request #51189 from austinvazquez/stop-support-for-container-config-mac-address
api/types/container: remove support for config mac address
2 parents 761a829 + 2537eae commit 40715ad

6 files changed

Lines changed: 10 additions & 18 deletions

File tree

api/docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ keywords: "API, Docker, rcli, REST, documentation"
5454
* Removed the `KernelMemoryTCP` field from the `GET /info` endpoint.
5555
* `GET /events` supports content-type negotiation and can produce either `application/x-ndjson`
5656
(Newline delimited JSON object stream) or `application/json-seq` (RFC7464).
57+
* `POST /containers/create` no longer supports configuring a container-wide MAC address
58+
via the container's `Config.MacAddress` field. A container's MAC address can now only
59+
be configured via endpoint settings when connecting to a network.
5760

5861
## v1.51 API changes
5962

api/docs/v1.52.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,13 +1390,6 @@ definitions:
13901390
description: "Disable networking for the container."
13911391
type: "boolean"
13921392
x-nullable: true
1393-
MacAddress:
1394-
description: |
1395-
MAC address of the container.
1396-
1397-
Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead.
1398-
type: "string"
1399-
x-nullable: true
14001393
OnBuild:
14011394
description: |
14021395
`ONBUILD` metadata that were defined in the image's `Dockerfile`.
@@ -7882,7 +7875,6 @@ paths:
78827875
/volumes/data: {}
78837876
WorkingDir: ""
78847877
NetworkDisabled: false
7885-
MacAddress: "12:34:56:78:9a:bc"
78867878
ExposedPorts:
78877879
22/tcp: {}
78887880
StopSignal: "SIGTERM"

api/swagger.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,13 +1390,6 @@ definitions:
13901390
description: "Disable networking for the container."
13911391
type: "boolean"
13921392
x-nullable: true
1393-
MacAddress:
1394-
description: |
1395-
MAC address of the container.
1396-
1397-
Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead.
1398-
type: "string"
1399-
x-nullable: true
14001393
OnBuild:
14011394
description: |
14021395
`ONBUILD` metadata that were defined in the image's `Dockerfile`.
@@ -7882,7 +7875,6 @@ paths:
78827875
/volumes/data: {}
78837876
WorkingDir: ""
78847877
NetworkDisabled: false
7885-
MacAddress: "12:34:56:78:9a:bc"
78867878
ExposedPorts:
78877879
22/tcp: {}
78887880
StopSignal: "SIGTERM"

api/types/container/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type Config struct {
4444
NetworkDisabled bool `json:",omitempty"` // Is network disabled
4545
// Mac Address of the container.
4646
//
47-
// Deprecated: this field is deprecated since API v1.44. Use EndpointSettings.MacAddress instead.
47+
// Deprecated: this field is deprecated since API v1.44 and obsolete since v1.52. Use EndpointSettings.MacAddress instead.
4848
MacAddress string `json:",omitempty"`
4949
OnBuild []string `json:",omitempty"` // ONBUILD metadata that were defined on the image Dockerfile
5050
Labels map[string]string // List of labels set to this container

daemon/server/router/container/container_routes.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,11 @@ func handleMACAddressBC(config *container.Config, hostConfig *container.HostConf
760760
if deprecatedMacAddress == "" {
761761
return "", nil
762762
}
763+
764+
if versions.GreaterThanOrEqualTo(version, "1.52") {
765+
return "", errdefs.InvalidParameter(errors.New("container-wide MAC address no longer supported; use endpoint-specific MAC address instead"))
766+
}
767+
763768
var warning string
764769
if hostConfig.NetworkMode.IsBridge() || hostConfig.NetworkMode.IsUserDefined() {
765770
ep, err := epConfigForNetMode(version, hostConfig.NetworkMode, networkingConfig)

vendor/github.com/moby/moby/api/types/container/config.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)