mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Replace Labels and Options nulls with {} in NetworkResource
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
This commit is contained in:
@ -127,6 +127,12 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt
|
|||||||
containerEndpoints[con.ID()] = containerEndpoint
|
containerEndpoints[con.ID()] = containerEndpoint
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
labels := network.GetNetworkLabels(conf)
|
||||||
|
if labels == nil {
|
||||||
|
labels = map[string]string{}
|
||||||
|
}
|
||||||
|
|
||||||
report := types.NetworkResource{
|
report := types.NetworkResource{
|
||||||
Name: conf.Name,
|
Name: conf.Name,
|
||||||
ID: network.GetNetworkID(conf.Name),
|
ID: network.GetNetworkID(conf.Name),
|
||||||
@ -136,7 +142,7 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt
|
|||||||
EnableIPv6: false,
|
EnableIPv6: false,
|
||||||
IPAM: dockerNetwork.IPAM{
|
IPAM: dockerNetwork.IPAM{
|
||||||
Driver: "default",
|
Driver: "default",
|
||||||
Options: nil,
|
Options: map[string]string{},
|
||||||
Config: ipamConfigs,
|
Config: ipamConfigs,
|
||||||
},
|
},
|
||||||
Internal: !bridge.IsGW,
|
Internal: !bridge.IsGW,
|
||||||
@ -145,8 +151,8 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt
|
|||||||
ConfigFrom: dockerNetwork.ConfigReference{},
|
ConfigFrom: dockerNetwork.ConfigReference{},
|
||||||
ConfigOnly: false,
|
ConfigOnly: false,
|
||||||
Containers: containerEndpoints,
|
Containers: containerEndpoints,
|
||||||
Options: nil,
|
Options: map[string]string{},
|
||||||
Labels: network.GetNetworkLabels(conf),
|
Labels: labels,
|
||||||
Peers: nil,
|
Peers: nil,
|
||||||
Services: nil,
|
Services: nil,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user