converge
converge copied to clipboard
support custom structs in Preparers
As a resource developer, I'd like to be able to read hcl into a custom type in my Preparer.
As an example, the docker.network resource supports network settings like
ipam_config {
subnet = "192.168.123.0/24"
gateway = "192.168.123.1"
}
Rather than using a map[string]string, I'd like to use a struct:
type IPAMConfig struct {
Subnet string `hcl:"subnet"`
Gateway string `hcl:"gateway"`
}
and read it in from the Preparer:
type Preparer struct {
...
IPAMConfig []IPAMConfig `hcl:"ipam_config"`
...
}