summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-22 20:41:39 -0500
committerGitHub <noreply@github.com>2021-02-22 20:41:39 -0500
commit96fc9d983e0fc5bae48c3cec3acce86cdb6e1059 (patch)
tree2ce23028b6631a1c33fdabf9d6b1a6cc7bc205c2 /pkg/api/handlers/compat
parent5ff5c487c65792b4d9ed2e3c88cf978c1978013c (diff)
parentfcf669fd98ec2b542fe242ff4643731897afa038 (diff)
downloadpodman-96fc9d983e0fc5bae48c3cec3acce86cdb6e1059.tar.gz
podman-96fc9d983e0fc5bae48c3cec3acce86cdb6e1059.tar.bz2
podman-96fc9d983e0fc5bae48c3cec3acce86cdb6e1059.zip
Merge pull request #9480 from jmguzik/replace-nil-with-braces-network-resource
[NO TESTS NEEDED] Replace Labels and Options nulls with {} in NetworkResource
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r--pkg/api/handlers/compat/networks.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go
index 36a5311f0..1a04b4289 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,
}