diff options
author | Federico Gimenez <fgimenez@redhat.com> | 2021-11-15 10:43:42 +0100 |
---|---|---|
committer | Federico Gimenez <fgimenez@redhat.com> | 2021-11-18 17:04:49 +0100 |
commit | 2e5d3e8fb34ba3ab42d53da9ba39b71e1f53bb75 (patch) | |
tree | 628cc3eb762c7af5383eff731c6e599d5fa6576e /libpod/define | |
parent | 9b964945d661d4f97b4a97f2f67d33f9dcd11e50 (diff) | |
download | podman-2e5d3e8fb34ba3ab42d53da9ba39b71e1f53bb75.tar.gz podman-2e5d3e8fb34ba3ab42d53da9ba39b71e1f53bb75.tar.bz2 podman-2e5d3e8fb34ba3ab42d53da9ba39b71e1f53bb75.zip |
Introduce Address type to be used in secondary IPv4 and IPv6 inspect data
structure.
Resolves a discrepancy between the types used in inspect for docker and podman.
This causes a panic when using the docker client against podman when the
secondary IP fields in the `NetworkSettings` inspect field are populated.
Fixes containers#12165
Signed-off-by: Federico Gimenez <fgimenez@redhat.com>
Diffstat (limited to 'libpod/define')
-rw-r--r-- | libpod/define/container_inspect.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go index 7decb18a8..9b73dbded 100644 --- a/libpod/define/container_inspect.go +++ b/libpod/define/container_inspect.go @@ -542,6 +542,12 @@ type InspectContainerHostConfig struct { CgroupConf map[string]string `json:"CgroupConf"` } +// Address represents an IP address. +type Address struct { + Addr string + PrefixLength int +} + // InspectBasicNetworkConfig holds basic configuration information (e.g. IP // addresses, MAC address, subnet masks, etc) that are common for all networks // (both additional and main). @@ -556,7 +562,7 @@ type InspectBasicNetworkConfig struct { IPPrefixLen int `json:"IPPrefixLen"` // SecondaryIPAddresses is a list of extra IP Addresses that the // container has been assigned in this network. - SecondaryIPAddresses []string `json:"SecondaryIPAddresses,omitempty"` + SecondaryIPAddresses []Address `json:"SecondaryIPAddresses,omitempty"` // IPv6Gateway is the IPv6 gateway this network will use. IPv6Gateway string `json:"IPv6Gateway"` // GlobalIPv6Address is the global-scope IPv6 Address for this network. @@ -565,7 +571,7 @@ type InspectBasicNetworkConfig struct { GlobalIPv6PrefixLen int `json:"GlobalIPv6PrefixLen"` // SecondaryIPv6Addresses is a list of extra IPv6 Addresses that the // container has been assigned in this network. - SecondaryIPv6Addresses []string `json:"SecondaryIPv6Addresses,omitempty"` + SecondaryIPv6Addresses []Address `json:"SecondaryIPv6Addresses,omitempty"` // MacAddress is the MAC address for the interface in this network. MacAddress string `json:"MacAddress"` // AdditionalMacAddresses is a set of additional MAC Addresses beyond |