Merge pull request #44026 from zhangyoufu/libnetwork-ipvlan-fix

libnetwork/drivers/ipvlan: fix missing IpvlanFlag field in config JSON
This commit is contained in:
Sebastiaan van Stijn 2022-08-24 13:45:09 +02:00 committed by GitHub
commit c7d74a2366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -154,6 +154,7 @@ func (config *configuration) MarshalJSON() ([]byte, error) {
nMap["Mtu"] = config.Mtu
nMap["Parent"] = config.Parent
nMap["IpvlanMode"] = config.IpvlanMode
nMap["IpvlanFlag"] = config.IpvlanFlag
nMap["Internal"] = config.Internal
nMap["CreatedSubIface"] = config.CreatedSlaveLink
if len(config.Ipv4Subnets) > 0 {
@ -187,6 +188,7 @@ func (config *configuration) UnmarshalJSON(b []byte) error {
config.Mtu = int(nMap["Mtu"].(float64))
config.Parent = nMap["Parent"].(string)
config.IpvlanMode = nMap["IpvlanMode"].(string)
config.IpvlanFlag = nMap["IpvlanFlag"].(string)
config.Internal = nMap["Internal"].(bool)
config.CreatedSlaveLink = nMap["CreatedSubIface"].(bool)
if v, ok := nMap["Ipv4Subnets"]; ok {