mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-18 23:06:10 -05:00
feat(container): add MAC address to state (#523)
Co-authored-by: Gustavo Michels <gmichels@nanthealth.com> Co-authored-by: Martin <Junkern@users.noreply.github.com>
This commit is contained in:
parent
a89059b6ca
commit
b15ea021d7
5 changed files with 12 additions and 0 deletions
|
|
@ -290,6 +290,7 @@ Read-Only:
|
|||
- `ip_address` (String)
|
||||
- `ip_prefix_length` (Number)
|
||||
- `ipv6_gateway` (String)
|
||||
- `mac_address` (String)
|
||||
- `network_name` (String)
|
||||
|
||||
## Import
|
||||
|
|
|
|||
|
|
@ -615,6 +615,11 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Description: "The IPV6 gateway of the container.",
|
||||
Computed: true,
|
||||
},
|
||||
"mac_address": {
|
||||
Type: schema.TypeString,
|
||||
Description: "The MAC address of the container.",
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -546,6 +546,10 @@ func resourceDockerContainerV1() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"mac_address": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ func flattenContainerNetworks(in *types.NetworkSettings) []interface{} {
|
|||
m["global_ipv6_address"] = networkData.GlobalIPv6Address
|
||||
m["global_ipv6_prefix_length"] = networkData.GlobalIPv6PrefixLen
|
||||
m["ipv6_gateway"] = networkData.IPv6Gateway
|
||||
m["mac_address"] = networkData.MacAddress
|
||||
out = append(out, m)
|
||||
}
|
||||
return out
|
||||
|
|
|
|||
|
|
@ -1508,6 +1508,7 @@ func TestAccDockerContainer_ipv4address(t *testing.T) {
|
|||
testAccContainerRunning("docker_container.foo", &c),
|
||||
testCheck,
|
||||
resource.TestCheckResourceAttr("docker_container.foo", "name", "tf-test"),
|
||||
resource.TestCheckResourceAttrSet("docker_container.foo", "network_data.0.mac_address"),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue