diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-01 21:43:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 21:43:27 +0100 |
commit | b7ff6f09121eee8a0444baede9f6c84cc1f12b71 (patch) | |
tree | dcedf6e0674998f3da09a51fe5e48510297ee2c4 /pkg/bindings | |
parent | 4b5cb7b1de3caecf0f78f264d5931066851c6a37 (diff) | |
parent | 8494bcb866f1c0978cbe35c62c1e3312a91040b4 (diff) | |
download | podman-b7ff6f09121eee8a0444baede9f6c84cc1f12b71.tar.gz podman-b7ff6f09121eee8a0444baede9f6c84cc1f12b71.tar.bz2 podman-b7ff6f09121eee8a0444baede9f6c84cc1f12b71.zip |
Merge pull request #8505 from Luap99/network-labels
podman network label support
Diffstat (limited to 'pkg/bindings')
-rw-r--r-- | pkg/bindings/network/network.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/bindings/network/network.go b/pkg/bindings/network/network.go index 1d4be8a4c..347f97703 100644 --- a/pkg/bindings/network/network.go +++ b/pkg/bindings/network/network.go @@ -2,6 +2,7 @@ package network import ( "context" + "encoding/json" "net/http" "net/url" "strconv" @@ -79,8 +80,12 @@ func List(ctx context.Context, options entities.NetworkListOptions) ([]*entities return nil, err } params := url.Values{} - if options.Filter != "" { - params.Set("filter", options.Filter) + if options.Filters != nil { + b, err := json.Marshal(options.Filters) + if err != nil { + return nil, err + } + params.Set("filters", string(b)) } response, err := conn.DoRequest(nil, http.MethodGet, "/networks/json", params, nil) if err != nil { |