libnetwork/drivers/ipvlan: fix missing IpvlanFlag field in config JSON

Fixes #42542

Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
(cherry picked from commit 549d24b437)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Youfu Zhang 2022-08-24 16:05:55 +08:00 committed by Sebastiaan van Stijn
parent 2dc3e510d4
commit 292d352ee4
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 0 deletions

View File

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