aboutsummaryrefslogtreecommitdiff
path: root/pkg/bindings/images/rm.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-12-07 10:54:54 -0600
committerbaude <bbaude@redhat.com>2020-12-10 12:53:08 -0600
commitead8b5be0f86293801fcf22ef41dddbddb02bef7 (patch)
tree16d616db423f93867e57b6b0cb0a27ff49f979d0 /pkg/bindings/images/rm.go
parent2bb149034bd67dd4027768863fed2fce853833ae (diff)
downloadpodman-ead8b5be0f86293801fcf22ef41dddbddb02bef7.tar.gz
podman-ead8b5be0f86293801fcf22ef41dddbddb02bef7.tar.bz2
podman-ead8b5be0f86293801fcf22ef41dddbddb02bef7.zip
Bindings refactor
this is step one of refactoring our golang binaries. we will no be using structs to pass optional options. required options will still arguments to the binding itself. the structs then have a generator to create helper functions which should then be added to the git repo. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/bindings/images/rm.go')
-rw-r--r--pkg/bindings/images/rm.go10
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