diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-11 05:36:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-11 05:36:08 -0500 |
commit | dd954781e6e308a0bbecfaf6699b41426100a58d (patch) | |
tree | 72c9df7f26356f61f2f37cb553d97a49ab837b61 /pkg/bindings/images/rm.go | |
parent | 6823a5d6cc771ed3c031518a759670dff7ee81b5 (diff) | |
parent | ead8b5be0f86293801fcf22ef41dddbddb02bef7 (diff) | |
download | podman-dd954781e6e308a0bbecfaf6699b41426100a58d.tar.gz podman-dd954781e6e308a0bbecfaf6699b41426100a58d.tar.bz2 podman-dd954781e6e308a0bbecfaf6699b41426100a58d.zip |
Merge pull request #8633 from baude/bindings3
Bindings refactor
Diffstat (limited to 'pkg/bindings/images/rm.go')
-rw-r--r-- | pkg/bindings/images/rm.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/bindings/images/rm.go b/pkg/bindings/images/rm.go index 9685b75e4..0b3b88165 100644 --- a/pkg/bindings/images/rm.go +++ b/pkg/bindings/images/rm.go @@ -41,17 +41,19 @@ func BatchRemove(ctx context.Context, images []string, opts entities.ImageRemove return &report.ImageRemoveReport, errorhandling.StringsToErrors(report.Errors) } -// Remove removes an image from the local storage. Use force to remove an +// Remove removes an image from the local storage. Use optional force option to remove an // image, even if it's used by containers. -func Remove(ctx context.Context, nameOrID string, force bool) (*entities.ImageRemoveReport, error) { +func Remove(ctx context.Context, nameOrID string, options *RemoveOptions) (*entities.ImageRemoveReport, error) { var report handlers.LibpodImagesRemoveReport conn, err := bindings.GetClient(ctx) if err != nil { return nil, err } - params := url.Values{} - params.Set("force", strconv.FormatBool(force)) + params, err := options.ToParams() + if err != nil { + return nil, err + } response, err := conn.DoRequest(nil, http.MethodDelete, "/images/%s", params, nil, nameOrID) if err != nil { return nil, err |