Skip to content

Commit

Permalink
Add a network-scoped mac_address field
Browse files Browse the repository at this point in the history
Related to:

- compose-spec/compose-spec#435

Signed-off-by: Albin Kerouanton <[email protected]>
(cherry picked from commit 0282c0c)
Signed-off-by: Albin Kerouanton <[email protected]>
  • Loading branch information
akerouanton authored and glours committed Nov 21, 2023
1 parent 6a91ca5 commit e390b97
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions loader/full-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ services:
other-network:
ipv4_address: 172.16.238.10
ipv6_address: 2001:3984:3989::10
mac_address: 02:42:72:98:65:08
other-other-network:

pid: "host"
Expand Down
5 changes: 4 additions & 1 deletion loader/full-struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
"other-network": {
Ipv4Address: "172.16.238.10",
Ipv6Address: "2001:3984:3989::10",
MacAddress: "02:42:72:98:65:08",
},
"other-other-network": nil,
},
Expand Down Expand Up @@ -775,6 +776,7 @@ services:
other-network:
ipv4_address: 172.16.238.10
ipv6_address: 2001:3984:3989::10
mac_address: 02:42:72:98:65:08
other-other-network: null
some-network:
aliases:
Expand Down Expand Up @@ -1392,7 +1394,8 @@ func fullExampleJSON(workingDir, homeDir string) string {
"networks": {
"other-network": {
"ipv4_address": "172.16.238.10",
"ipv6_address": "2001:3984:3989::10"
"ipv6_address": "2001:3984:3989::10",
"mac_address": "02:42:72:98:65:08"
},
"other-other-network": null,
"some-network": {
Expand Down
1 change: 1 addition & 0 deletions schema/compose-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
"ipv4_address": {"type": "string"},
"ipv6_address": {"type": "string"},
"link_local_ips": {"$ref": "#/definitions/list_of_strings"},
"mac_address": {"type": "string"},
"priority": {"type": "number"}
},
"additionalProperties": false,
Expand Down
1 change: 1 addition & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ type ServiceNetworkConfig struct {
Ipv4Address string `yaml:"ipv4_address,omitempty" json:"ipv4_address,omitempty"`
Ipv6Address string `yaml:"ipv6_address,omitempty" json:"ipv6_address,omitempty"`
LinkLocalIPs []string `yaml:"link_local_ips,omitempty" json:"link_local_ips,omitempty"`
MacAddress string `yaml:"mac_address,omitempty" json:"mac_address,omitempty"`

Extensions Extensions `yaml:"#extensions,inline" json:"-"`
}
Expand Down

0 comments on commit e390b97

Please sign in to comment.