summaryrefslogtreecommitdiff
path: root/pkg/bindings/network/network.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-12 15:50:22 +0200
committerGitHub <noreply@github.com>2021-04-12 15:50:22 +0200
commit0ac73f25eb45611324f255b5222863b6ff0e8525 (patch)
treef2c8ff0fa46e06b5fd5864765699180b674955c5 /pkg/bindings/network/network.go
parent9d3e31071087908207a8f7fdc84939edf3dc47c0 (diff)
parent94b972630643b6f4b472a4b03f58fa757d3ca6a5 (diff)
downloadpodman-0ac73f25eb45611324f255b5222863b6ff0e8525.tar.gz
podman-0ac73f25eb45611324f255b5222863b6ff0e8525.tar.bz2
podman-0ac73f25eb45611324f255b5222863b6ff0e8525.zip
Merge pull request #9988 from jmguzik/prune-filters-bindings-net
Add network prune filters support to bindings
Diffstat (limited to 'pkg/bindings/network/network.go')
-rw-r--r--pkg/bindings/network/network.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/bindings/network/network.go b/pkg/bindings/network/network.go
index 6f3aa8594..17451c273 100644
--- a/pkg/bindings/network/network.go
+++ b/pkg/bindings/network/network.go
@@ -184,7 +184,13 @@ func Exists(ctx context.Context, nameOrID string, options *ExistsOptions) (bool,
// Prune removes unused CNI networks
func Prune(ctx context.Context, options *PruneOptions) ([]*entities.NetworkPruneReport, error) {
- // TODO Filters is not implemented
+ if options == nil {
+ options = new(PruneOptions)
+ }
+ params, err := options.ToParams()
+ if err != nil {
+ return nil, err
+ }
var (
prunedNetworks []*entities.NetworkPruneReport
)
@@ -193,7 +199,7 @@ func Prune(ctx context.Context, options *PruneOptions) ([]*entities.NetworkPrune
return nil, err
}
- response, err := conn.DoRequest(nil, http.MethodPost, "/networks/prune", nil, nil)
+ response, err := conn.DoRequest(nil, http.MethodPost, "/networks/prune", params, nil)
if err != nil {
return nil, err
}