Add docker container network settings to output attribute
This commit is contained in:
parent
97482f8b0c
commit
c2319da1aa
|
@ -116,6 +116,26 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Set: stringSetHash,
|
||||
},
|
||||
|
||||
"ip_address": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"ip_prefix_length": &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"gateway": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"bridge": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,6 +138,12 @@ func resourceDockerContainerRead(d *schema.ResourceData, meta interface{}) error
|
|||
return resourceDockerContainerDelete(d, meta)
|
||||
}
|
||||
|
||||
// Read Network Settings
|
||||
d.Set("ip_address", container.NetworkSettings.IPAddress)
|
||||
d.Set("ip_prefix_length", container.NetworkSettings.IPPrefixLen)
|
||||
d.Set("gateway", container.NetworkSettings.Gateway)
|
||||
d.Set("bridge", container.NetworkSettings.Bridge)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue