diff options
author | Jakub Guzik <jakubmguzik@gmail.com> | 2021-02-23 00:11:41 +0100 |
---|---|---|
committer | Jakub Guzik <jakubmguzik@gmail.com> | 2021-02-23 00:31:17 +0100 |
commit | fcf669fd98ec2b542fe242ff4643731897afa038 (patch) | |
tree | 43c421ec2d6e3c9d448a3ffeade4071fc3b83ca7 /pkg | |
parent | 4a6582bd86572f0336c82577a0a4f315376c7179 (diff) | |
download | podman-fcf669fd98ec2b542fe242ff4643731897afa038.tar.gz podman-fcf669fd98ec2b542fe242ff4643731897afa038.tar.bz2 podman-fcf669fd98ec2b542fe242ff4643731897afa038.zip |
Replace Labels and Options nulls with {} in NetworkResource
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/api/handlers/compat/networks.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index 71b9d180d..ff63e6625 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -127,6 +127,12 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt containerEndpoints[con.ID()] = containerEndpoint } } + + labels := network.GetNetworkLabels(conf) + if labels == nil { + labels = map[string]string{} + } + report := types.NetworkResource{ Name: conf.Name, ID: network.GetNetworkID(conf.Name), @@ -136,7 +142,7 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt EnableIPv6: false, IPAM: dockerNetwork.IPAM{ Driver: "default", - Options: nil, + Options: map[string]string{}, Config: ipamConfigs, }, Internal: !bridge.IsGW, @@ -145,8 +151,8 @@ func getNetworkResourceByNameOrID(nameOrID string, runtime *libpod.Runtime, filt ConfigFrom: dockerNetwork.ConfigReference{}, ConfigOnly: false, Containers: containerEndpoints, - Options: nil, - Labels: network.GetNetworkLabels(conf), + Options: map[string]string{}, + Labels: labels, Peers: nil, Services: nil, } |