mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-18 23:06:10 -05:00
feat: implement mac_address for networks_advanced (#794)
This commit is contained in:
parent
e2c8d0b73a
commit
9a17ba0670
3 changed files with 11 additions and 0 deletions
|
|
@ -232,6 +232,7 @@ Optional:
|
|||
- `aliases` (Set of String) The network aliases of the container in the specific network.
|
||||
- `ipv4_address` (String) The IPV4 address of the container in the specific network.
|
||||
- `ipv6_address` (String) The IPV6 address of the container in the specific network.
|
||||
- `mac_address` (String) The MAC address of the container in the specific network.
|
||||
|
||||
|
||||
<a id="nestedblock--ports"></a>
|
||||
|
|
|
|||
|
|
@ -778,6 +778,12 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"mac_address": {
|
||||
Type: schema.TypeString,
|
||||
Description: "The MAC address of the container in the specific network.",
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -460,6 +460,10 @@ func resourceDockerContainerCreate(ctx context.Context, d *schema.ResourceData,
|
|||
}
|
||||
endpointConfig.IPAMConfig = endpointIPAMConfig
|
||||
|
||||
if v, ok := rawNetwork.(map[string]interface{})["mac_address"]; ok {
|
||||
endpointConfig.MacAddress = v.(string)
|
||||
}
|
||||
|
||||
if err := client.NetworkConnect(ctx, networkID, retContainer.ID, endpointConfig); err != nil {
|
||||
return diag.Errorf("Unable to connect to network '%s': %s", networkID, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue