Skip to content

Commit 7450da6

Browse files
committed
types: add support for enable_ipv6
The enable_ipv6 property specified in the network spec was missing from the NetworkConfig struct. Because of this ommission, users of this library had no visibility into this setting. In particular, this prevented the docker-compose v2 application from creating a Network object in docker with an appropriate setting for the EnableIPv6 option. This change parses the "enable_ipv6" property into the NetworkConfig struct and makes it available in the EnableIPv6 field for any downstream library users to use. Signed-off-by: Stacey Sheldon <[email protected]>
1 parent 97822e0 commit 7450da6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

loader/interpolate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ var interpolateTypeCastMapping = map[interp.Path]interp.Cast{
7171
iPath("networks", interp.PathMatchAll, "external"): toBoolean,
7272
iPath("networks", interp.PathMatchAll, "internal"): toBoolean,
7373
iPath("networks", interp.PathMatchAll, "attachable"): toBoolean,
74+
iPath("networks", interp.PathMatchAll, "enable_ipv6"): toBoolean,
7475
iPath("volumes", interp.PathMatchAll, "external"): toBoolean,
7576
iPath("secrets", interp.PathMatchAll, "external"): toBoolean,
7677
iPath("configs", interp.PathMatchAll, "external"): toBoolean,

types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ type NetworkConfig struct {
748748
Internal bool `yaml:",omitempty" json:"internal,omitempty"`
749749
Attachable bool `yaml:",omitempty" json:"attachable,omitempty"`
750750
Labels Labels `yaml:",omitempty" json:"labels,omitempty"`
751+
EnableIPv6 bool `mapstructure:"enable_ipv6" yaml:"enable_ipv6,omitempty" json:"enable_ipv6,omitempty"`
751752
Extensions map[string]interface{} `yaml:",inline" json:"-"`
752753
}
753754

0 commit comments

Comments
 (0)