Skip to content

Commit e390b97

Browse files
akerouantonglours
authored andcommitted
Add a network-scoped mac_address field
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]>
1 parent 6a91ca5 commit e390b97

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

loader/full-example.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ services:
235235
other-network:
236236
ipv4_address: 172.16.238.10
237237
ipv6_address: 2001:3984:3989::10
238+
mac_address: 02:42:72:98:65:08
238239
other-other-network:
239240

240241
pid: "host"

loader/full-struct_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
233233
"other-network": {
234234
Ipv4Address: "172.16.238.10",
235235
Ipv6Address: "2001:3984:3989::10",
236+
MacAddress: "02:42:72:98:65:08",
236237
},
237238
"other-other-network": nil,
238239
},
@@ -775,6 +776,7 @@ services:
775776
other-network:
776777
ipv4_address: 172.16.238.10
777778
ipv6_address: 2001:3984:3989::10
779+
mac_address: 02:42:72:98:65:08
778780
other-other-network: null
779781
some-network:
780782
aliases:
@@ -1392,7 +1394,8 @@ func fullExampleJSON(workingDir, homeDir string) string {
13921394
"networks": {
13931395
"other-network": {
13941396
"ipv4_address": "172.16.238.10",
1395-
"ipv6_address": "2001:3984:3989::10"
1397+
"ipv6_address": "2001:3984:3989::10",
1398+
"mac_address": "02:42:72:98:65:08"
13961399
},
13971400
"other-other-network": null,
13981401
"some-network": {

schema/compose-spec.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@
294294
"ipv4_address": {"type": "string"},
295295
"ipv6_address": {"type": "string"},
296296
"link_local_ips": {"$ref": "#/definitions/list_of_strings"},
297+
"mac_address": {"type": "string"},
297298
"priority": {"type": "number"}
298299
},
299300
"additionalProperties": false,

types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ type ServiceNetworkConfig struct {
611611
Ipv4Address string `yaml:"ipv4_address,omitempty" json:"ipv4_address,omitempty"`
612612
Ipv6Address string `yaml:"ipv6_address,omitempty" json:"ipv6_address,omitempty"`
613613
LinkLocalIPs []string `yaml:"link_local_ips,omitempty" json:"link_local_ips,omitempty"`
614+
MacAddress string `yaml:"mac_address,omitempty" json:"mac_address,omitempty"`
614615

615616
Extensions Extensions `yaml:"#extensions,inline" json:"-"`
616617
}

0 commit comments

Comments
 (0)