diff options
Diffstat (limited to 'pkg/bindings')
97 files changed, 358 insertions, 232 deletions
diff --git a/pkg/bindings/containers/containers.go b/pkg/bindings/containers/containers.go index 650aa9ac5..1081a0e61 100644 --- a/pkg/bindings/containers/containers.go +++ b/pkg/bindings/containers/containers.go @@ -12,6 +12,7 @@ import ( "github.com/containers/podman/v2/pkg/api/handlers" "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/entities/reports" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -49,11 +50,11 @@ func List(ctx context.Context, options *ListOptions) ([]entities.ListContainer, // used for more granular selection of containers. The main error returned indicates if there were runtime // errors like finding containers. Errors specific to the removal of a container are in the PruneContainerResponse // structure. -func Prune(ctx context.Context, options *PruneOptions) (*entities.ContainerPruneReport, error) { +func Prune(ctx context.Context, options *PruneOptions) ([]*reports.PruneReport, error) { if options == nil { options = new(PruneOptions) } - var reports *entities.ContainerPruneReport + var reports []*reports.PruneReport conn, err := bindings.GetClient(ctx) if err != nil { return nil, err diff --git a/pkg/bindings/containers/rename.go b/pkg/bindings/containers/rename.go new file mode 100644 index 000000000..0e8c7f198 --- /dev/null +++ b/pkg/bindings/containers/rename.go @@ -0,0 +1,28 @@ +package containers + +import ( + "context" + "net/http" + + "github.com/containers/podman/v2/pkg/bindings" +) + +// Rename an existing container. +func Rename(ctx context.Context, nameOrID string, options *RenameOptions) error { + if options == nil { + options = new(RenameOptions) + } + conn, err := bindings.GetClient(ctx) + if err != nil { + return err + } + params, err := options.ToParams() + if err != nil { + return err + } + response, err := conn.DoRequest(nil, http.MethodPost, "/containers/%s/rename", params, nil, nameOrID) + if err != nil { + return err + } + return response.Process(nil) +} diff --git a/pkg/bindings/containers/types.go b/pkg/bindings/containers/types.go index 24402e982..10f553e52 100644 --- a/pkg/bindings/containers/types.go +++ b/pkg/bindings/containers/types.go @@ -194,6 +194,13 @@ type InitOptions struct{} // ShouldRestartOptions type ShouldRestartOptions struct{} +//go:generate go run ../generator/generator.go RenameOptions +// RenameOptions are options for renaming containers. +// The Name field is required. +type RenameOptions struct { + Name *string +} + //go:generate go run ../generator/generator.go ResizeTTYOptions // ResizeTTYOptions are optional options for resizing // container TTYs diff --git a/pkg/bindings/containers/types_attach_options.go b/pkg/bindings/containers/types_attach_options.go index 4ffb8ab17..6d8c1cb01 100644 --- a/pkg/bindings/containers/types_attach_options.go +++ b/pkg/bindings/containers/types_attach_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:18.566804404 -0600 CST m=+0.000258831 */ // Changed @@ -39,6 +38,7 @@ func (o *AttachOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_checkpoint_options.go b/pkg/bindings/containers/types_checkpoint_options.go index d03dc8231..ec766de4a 100644 --- a/pkg/bindings/containers/types_checkpoint_options.go +++ b/pkg/bindings/containers/types_checkpoint_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:18.714853285 -0600 CST m=+0.000319103 */ // Changed @@ -39,6 +38,7 @@ func (o *CheckpointOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_commit_options.go b/pkg/bindings/containers/types_commit_options.go index a8b215141..b745bebe2 100644 --- a/pkg/bindings/containers/types_commit_options.go +++ b/pkg/bindings/containers/types_commit_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:18.420656951 -0600 CST m=+0.000259662 */ // Changed @@ -39,6 +38,7 @@ func (o *CommitOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_create_options.go b/pkg/bindings/containers/types_create_options.go index 4dbce0203..4b9574cf1 100644 --- a/pkg/bindings/containers/types_create_options.go +++ b/pkg/bindings/containers/types_create_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:19.011789618 -0600 CST m=+0.000259413 */ // Changed @@ -39,6 +38,7 @@ func (o *CreateOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_diff_options.go b/pkg/bindings/containers/types_diff_options.go index be3bbf554..55fa6930d 100644 --- a/pkg/bindings/containers/types_diff_options.go +++ b/pkg/bindings/containers/types_diff_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:19.159128927 -0600 CST m=+0.000255635 */ // Changed @@ -39,6 +38,7 @@ func (o *DiffOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_execinspect_options.go b/pkg/bindings/containers/types_execinspect_options.go index 3c4c870be..c5d1f931a 100644 --- a/pkg/bindings/containers/types_execinspect_options.go +++ b/pkg/bindings/containers/types_execinspect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:19.303239014 -0600 CST m=+0.000256861 */ // Changed @@ -39,6 +38,7 @@ func (o *ExecInspectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_execstart_options.go b/pkg/bindings/containers/types_execstart_options.go index 66fdc82cb..9ecb70a3e 100644 --- a/pkg/bindings/containers/types_execstart_options.go +++ b/pkg/bindings/containers/types_execstart_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:19.447714428 -0600 CST m=+0.000257278 */ // Changed @@ -39,6 +38,7 @@ func (o *ExecStartOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_execstartandattach_options.go b/pkg/bindings/containers/types_execstartandattach_options.go index 43900d29d..a5a691e35 100644 --- a/pkg/bindings/containers/types_execstartandattach_options.go +++ b/pkg/bindings/containers/types_execstartandattach_options.go @@ -6,6 +6,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -13,8 +14,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:22.827903078 -0600 CST m=+0.000269906 */ // Changed @@ -41,6 +40,7 @@ func (o *ExecStartAndAttachOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_export_options.go b/pkg/bindings/containers/types_export_options.go index e325bd2cd..55e413c72 100644 --- a/pkg/bindings/containers/types_export_options.go +++ b/pkg/bindings/containers/types_export_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:22.101679998 -0600 CST m=+0.000261669 */ // Changed @@ -39,6 +38,7 @@ func (o *ExportOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_healthcheck_options.go b/pkg/bindings/containers/types_healthcheck_options.go index 8c4300366..9d8b25bf4 100644 --- a/pkg/bindings/containers/types_healthcheck_options.go +++ b/pkg/bindings/containers/types_healthcheck_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:19.593883686 -0600 CST m=+0.000289845 */ // Changed @@ -39,6 +38,7 @@ func (o *HealthCheckOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_init_options.go b/pkg/bindings/containers/types_init_options.go index 655362f62..6fb5795c0 100644 --- a/pkg/bindings/containers/types_init_options.go +++ b/pkg/bindings/containers/types_init_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:22.245077233 -0600 CST m=+0.000255461 */ // Changed @@ -39,6 +38,7 @@ func (o *InitOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_inspect_options.go b/pkg/bindings/containers/types_inspect_options.go index 884f5524d..722372414 100644 --- a/pkg/bindings/containers/types_inspect_options.go +++ b/pkg/bindings/containers/types_inspect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:20.635987603 -0600 CST m=+0.000260270 */ // Changed @@ -39,6 +38,7 @@ func (o *InspectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_kill_options.go b/pkg/bindings/containers/types_kill_options.go index 3d6fa6224..dd84f0d9f 100644 --- a/pkg/bindings/containers/types_kill_options.go +++ b/pkg/bindings/containers/types_kill_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:20.781581076 -0600 CST m=+0.000259040 */ // Changed @@ -39,6 +38,7 @@ func (o *KillOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_list_options.go b/pkg/bindings/containers/types_list_options.go index dd74d37b7..43326fa59 100644 --- a/pkg/bindings/containers/types_list_options.go +++ b/pkg/bindings/containers/types_list_options.go @@ -12,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:20.199081744 -0600 CST m=+0.000270626 */ // Changed diff --git a/pkg/bindings/containers/types_log_options.go b/pkg/bindings/containers/types_log_options.go index a6958242f..364f29de4 100644 --- a/pkg/bindings/containers/types_log_options.go +++ b/pkg/bindings/containers/types_log_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:18.273264471 -0600 CST m=+0.000274536 */ // Changed @@ -39,6 +38,7 @@ func (o *LogOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_mount_options.go b/pkg/bindings/containers/types_mount_options.go index c0e253094..6f4349b73 100644 --- a/pkg/bindings/containers/types_mount_options.go +++ b/pkg/bindings/containers/types_mount_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:19.740822464 -0600 CST m=+0.000250074 */ // Changed @@ -39,6 +38,7 @@ func (o *MountOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_mountedcontainerpaths_options.go b/pkg/bindings/containers/types_mountedcontainerpaths_options.go index e368ff131..0d8b69654 100644 --- a/pkg/bindings/containers/types_mountedcontainerpaths_options.go +++ b/pkg/bindings/containers/types_mountedcontainerpaths_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:20.048233253 -0600 CST m=+0.000307223 */ // Changed @@ -39,6 +38,7 @@ func (o *MountedContainerPathsOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_pause_options.go b/pkg/bindings/containers/types_pause_options.go index 26ad86793..0cc65f64e 100644 --- a/pkg/bindings/containers/types_pause_options.go +++ b/pkg/bindings/containers/types_pause_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:20.929891294 -0600 CST m=+0.000261081 */ // Changed @@ -39,6 +38,7 @@ func (o *PauseOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_prune_options.go b/pkg/bindings/containers/types_prune_options.go index e3c0f4de7..10adf0a2a 100644 --- a/pkg/bindings/containers/types_prune_options.go +++ b/pkg/bindings/containers/types_prune_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:20.344278799 -0600 CST m=+0.000263499 */ // Changed @@ -39,6 +38,7 @@ func (o *PruneOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_remove_options.go b/pkg/bindings/containers/types_remove_options.go index 6f59f0ed5..e21fb41f7 100644 --- a/pkg/bindings/containers/types_remove_options.go +++ b/pkg/bindings/containers/types_remove_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:20.489968735 -0600 CST m=+0.000264450 */ // Changed @@ -39,6 +38,7 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_rename_options.go b/pkg/bindings/containers/types_rename_options.go new file mode 100644 index 000000000..b7a723f7a --- /dev/null +++ b/pkg/bindings/containers/types_rename_options.go @@ -0,0 +1,104 @@ +package containers + +import ( + "net/url" + "reflect" + "strconv" + "strings" + + jsoniter "github.com/json-iterator/go" + "github.com/pkg/errors" +) + +/* +This file is generated automatically by go generate. Do not edit. +*/ + +// Changed +func (o *RenameOptions) Changed(fieldName string) bool { + r := reflect.ValueOf(o) + value := reflect.Indirect(r).FieldByName(fieldName) + return !value.IsNil() +} + +// ToParams +func (o *RenameOptions) ToParams() (url.Values, error) { + params := url.Values{} + if o == nil { + return params, nil + } + json := jsoniter.ConfigCompatibleWithStandardLibrary + s := reflect.ValueOf(o) + if reflect.Ptr == s.Kind() { + s = s.Elem() + } + sType := s.Type() + for i := 0; i < s.NumField(); i++ { + fieldName := sType.Field(i).Name + if !o.Changed(fieldName) { + continue + } + fieldName = strings.ToLower(fieldName) + f := s.Field(i) + if reflect.Ptr == f.Kind() { + f = f.Elem() + } + switch f.Kind() { + case reflect.Bool: + params.Set(fieldName, strconv.FormatBool(f.Bool())) + case reflect.String: + params.Set(fieldName, f.String()) + case reflect.Int, reflect.Int64: + // f.Int() is always an int64 + params.Set(fieldName, strconv.FormatInt(f.Int(), 10)) + case reflect.Uint, reflect.Uint64: + // f.Uint() is always an uint64 + params.Set(fieldName, strconv.FormatUint(f.Uint(), 10)) + case reflect.Slice: + typ := reflect.TypeOf(f.Interface()).Elem() + switch typ.Kind() { + case reflect.String: + sl := f.Slice(0, f.Len()) + s, ok := sl.Interface().([]string) + if !ok { + return nil, errors.New("failed to convert to string slice") + } + for _, val := range s { + params.Add(fieldName, val) + } + default: + return nil, errors.Errorf("unknown slice type %s", f.Kind().String()) + } + case reflect.Map: + lowerCaseKeys := make(map[string][]string) + iter := f.MapRange() + for iter.Next() { + lowerCaseKeys[iter.Key().Interface().(string)] = iter.Value().Interface().([]string) + + } + s, err := json.MarshalToString(lowerCaseKeys) + if err != nil { + return nil, err + } + + params.Set(fieldName, s) + } + } + return params, nil +} + +// WithName +func (o *RenameOptions) WithName(value string) *RenameOptions { + v := &value + o.Name = v + return o +} + +// GetName +func (o *RenameOptions) GetName() string { + var name string + if o.Name == nil { + return name + } + return *o.Name +} diff --git a/pkg/bindings/containers/types_resizeexectty_options.go b/pkg/bindings/containers/types_resizeexectty_options.go index 33bb4e78b..0212adeb2 100644 --- a/pkg/bindings/containers/types_resizeexectty_options.go +++ b/pkg/bindings/containers/types_resizeexectty_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:22.680735758 -0600 CST m=+0.000267081 */ // Changed @@ -39,6 +38,7 @@ func (o *ResizeExecTTYOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_resizetty_options.go b/pkg/bindings/containers/types_resizetty_options.go index 29ec54988..cee607902 100644 --- a/pkg/bindings/containers/types_resizetty_options.go +++ b/pkg/bindings/containers/types_resizetty_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:22.535788375 -0600 CST m=+0.000266528 */ // Changed @@ -39,6 +38,7 @@ func (o *ResizeTTYOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_restart_options.go b/pkg/bindings/containers/types_restart_options.go index 13ac099b1..8dcc6b5b7 100644 --- a/pkg/bindings/containers/types_restart_options.go +++ b/pkg/bindings/containers/types_restart_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:21.076709643 -0600 CST m=+0.000303354 */ // Changed @@ -39,6 +38,7 @@ func (o *RestartOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_restore_options.go b/pkg/bindings/containers/types_restore_options.go index be6e94736..491d678a5 100644 --- a/pkg/bindings/containers/types_restore_options.go +++ b/pkg/bindings/containers/types_restore_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:18.861536405 -0600 CST m=+0.000300026 */ // Changed @@ -39,6 +38,7 @@ func (o *RestoreOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_shouldrestart_options.go b/pkg/bindings/containers/types_shouldrestart_options.go index c833d0d8b..30ab618c7 100644 --- a/pkg/bindings/containers/types_shouldrestart_options.go +++ b/pkg/bindings/containers/types_shouldrestart_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:22.388596051 -0600 CST m=+0.000253693 */ // Changed @@ -39,6 +38,7 @@ func (o *ShouldRestartOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_start_options.go b/pkg/bindings/containers/types_start_options.go index 5918af89b..4050a8993 100644 --- a/pkg/bindings/containers/types_start_options.go +++ b/pkg/bindings/containers/types_start_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:21.221364502 -0600 CST m=+0.000276575 */ // Changed @@ -39,6 +38,7 @@ func (o *StartOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_stats_options.go b/pkg/bindings/containers/types_stats_options.go index f821ea1cd..74f419913 100644 --- a/pkg/bindings/containers/types_stats_options.go +++ b/pkg/bindings/containers/types_stats_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:21.370213399 -0600 CST m=+0.000264334 */ // Changed @@ -39,6 +38,7 @@ func (o *StatsOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_stop_options.go b/pkg/bindings/containers/types_stop_options.go index 14d7633a0..db692dbf0 100644 --- a/pkg/bindings/containers/types_stop_options.go +++ b/pkg/bindings/containers/types_stop_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:21.95469621 -0600 CST m=+0.000261399 */ // Changed @@ -39,6 +38,7 @@ func (o *StopOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_top_options.go b/pkg/bindings/containers/types_top_options.go index 95a1ee686..5f2717c28 100644 --- a/pkg/bindings/containers/types_top_options.go +++ b/pkg/bindings/containers/types_top_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:21.515867629 -0600 CST m=+0.000257106 */ // Changed @@ -39,6 +38,7 @@ func (o *TopOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_unmount_options.go b/pkg/bindings/containers/types_unmount_options.go index a29bd8216..060327c4a 100644 --- a/pkg/bindings/containers/types_unmount_options.go +++ b/pkg/bindings/containers/types_unmount_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:19.891657824 -0600 CST m=+0.000326668 */ // Changed @@ -39,6 +38,7 @@ func (o *UnmountOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_unpause_options.go b/pkg/bindings/containers/types_unpause_options.go index 44c077df2..e02bf2c95 100644 --- a/pkg/bindings/containers/types_unpause_options.go +++ b/pkg/bindings/containers/types_unpause_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:21.661356277 -0600 CST m=+0.000262608 */ // Changed @@ -39,6 +38,7 @@ func (o *UnpauseOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/containers/types_wait_options.go b/pkg/bindings/containers/types_wait_options.go index 18d36c377..470d67611 100644 --- a/pkg/bindings/containers/types_wait_options.go +++ b/pkg/bindings/containers/types_wait_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" "github.com/containers/podman/v2/libpod/define" jsoniter "github.com/json-iterator/go" @@ -12,8 +13,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 13:33:21.809397978 -0600 CST m=+0.000267049 */ // Changed @@ -40,6 +39,7 @@ func (o *WaitOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/errors.go b/pkg/bindings/errors.go index 603299389..e75ce898d 100644 --- a/pkg/bindings/errors.go +++ b/pkg/bindings/errors.go @@ -4,7 +4,7 @@ import ( "encoding/json" "io/ioutil" - "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/errorhandling" "github.com/pkg/errors" ) @@ -13,7 +13,7 @@ var ( ) func handleError(data []byte) error { - e := entities.ErrorModel{} + e := errorhandling.ErrorModel{} if err := json.Unmarshal(data, &e); err != nil { return err } @@ -36,7 +36,7 @@ func (a APIResponse) Process(unmarshalInto interface{}) error { } func CheckResponseCode(inError error) (int, error) { - e, ok := inError.(entities.ErrorModel) + e, ok := inError.(errorhandling.ErrorModel) if !ok { return -1, errors.New("error is not type ErrorModel") } diff --git a/pkg/bindings/generate/types_kube_options.go b/pkg/bindings/generate/types_kube_options.go index 68488aaee..5fb965c9f 100644 --- a/pkg/bindings/generate/types_kube_options.go +++ b/pkg/bindings/generate/types_kube_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:20.522950566 -0600 CST m=+0.000154384 */ // Changed @@ -39,6 +38,7 @@ func (o *KubeOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/generate/types_systemd_options.go b/pkg/bindings/generate/types_systemd_options.go index 0e8a46aa0..ce7286b3a 100644 --- a/pkg/bindings/generate/types_systemd_options.go +++ b/pkg/bindings/generate/types_systemd_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:20.661450253 -0600 CST m=+0.000135779 */ // Changed @@ -39,6 +38,7 @@ func (o *SystemdOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/generator/generator.go b/pkg/bindings/generator/generator.go index 8c79aebae..6a7f600a8 100644 --- a/pkg/bindings/generator/generator.go +++ b/pkg/bindings/generator/generator.go @@ -19,13 +19,10 @@ var bodyTmpl = `package {{.PackageName}} import ( {{range $import := .Imports}} {{$import}} {{end}} - ) /* This file is generated automatically by go generate. Do not edit. - -Created {{.Date}} */ // Changed @@ -52,6 +49,7 @@ func (o *{{.StructName}}) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() @@ -239,7 +237,7 @@ func main() { closed = true // go fmt file - gofmt := exec.Command("gofmt", "-w", "-s", out.Name()) + gofmt := exec.Command("go", "fmt", out.Name()) gofmt.Stderr = os.Stdout if err := gofmt.Run(); err != nil { fmt.Println(err) diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go index 9beb493c8..ae6962c8c 100644 --- a/pkg/bindings/images/images.go +++ b/pkg/bindings/images/images.go @@ -12,6 +12,7 @@ import ( "github.com/containers/podman/v2/pkg/auth" "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/entities/reports" "github.com/pkg/errors" ) @@ -112,20 +113,13 @@ func History(ctx context.Context, nameOrID string, options *HistoryOptions) ([]* return history, response.Process(&history) } -func Load(ctx context.Context, r io.Reader, options *LoadOptions) (*entities.ImageLoadReport, error) { - if options == nil { - options = new(LoadOptions) - } +func Load(ctx context.Context, r io.Reader) (*entities.ImageLoadReport, error) { var report entities.ImageLoadReport conn, err := bindings.GetClient(ctx) if err != nil { return nil, err } - params, err := options.ToParams() - if err != nil { - return nil, err - } - response, err := conn.DoRequest(r, http.MethodPost, "/images/load", params, nil) + response, err := conn.DoRequest(r, http.MethodPost, "/images/load", nil, nil) if err != nil { return nil, err } @@ -163,9 +157,9 @@ func Export(ctx context.Context, nameOrIDs []string, w io.Writer, options *Expor // Prune removes unused images from local storage. The optional filters can be used to further // define which images should be pruned. -func Prune(ctx context.Context, options *PruneOptions) ([]string, error) { +func Prune(ctx context.Context, options *PruneOptions) ([]*reports.PruneReport, error) { var ( - deleted []string + deleted []*reports.PruneReport ) if options == nil { options = new(PruneOptions) @@ -182,7 +176,8 @@ func Prune(ctx context.Context, options *PruneOptions) ([]string, error) { if err != nil { return deleted, err } - return deleted, response.Process(&deleted) + err = response.Process(&deleted) + return deleted, err } // Tag adds an additional name to locally-stored image. Both the tag and repo parameters are required. diff --git a/pkg/bindings/images/types_diff_options.go b/pkg/bindings/images/types_diff_options.go index d27c8945e..34a5bf2df 100644 --- a/pkg/bindings/images/types_diff_options.go +++ b/pkg/bindings/images/types_diff_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:26.320022698 -0600 CST m=+0.000277796 */ // Changed @@ -39,6 +38,7 @@ func (o *DiffOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_export_options.go b/pkg/bindings/images/types_export_options.go index 078b27fc0..172cb2b5c 100644 --- a/pkg/bindings/images/types_export_options.go +++ b/pkg/bindings/images/types_export_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:27.173810543 -0600 CST m=+0.000239871 */ // Changed @@ -39,6 +38,7 @@ func (o *ExportOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_get_options.go b/pkg/bindings/images/types_get_options.go index 1161657f7..c91ddb170 100644 --- a/pkg/bindings/images/types_get_options.go +++ b/pkg/bindings/images/types_get_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:26.609005517 -0600 CST m=+0.000241828 */ // Changed @@ -39,6 +38,7 @@ func (o *GetOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_history_options.go b/pkg/bindings/images/types_history_options.go index 6f9854e03..bd4224cd8 100644 --- a/pkg/bindings/images/types_history_options.go +++ b/pkg/bindings/images/types_history_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:26.890854681 -0600 CST m=+0.000243668 */ // Changed @@ -39,6 +38,7 @@ func (o *HistoryOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_import_options.go b/pkg/bindings/images/types_import_options.go index f5e6c8f7e..81eda946e 100644 --- a/pkg/bindings/images/types_import_options.go +++ b/pkg/bindings/images/types_import_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:27.740585278 -0600 CST m=+0.000340441 */ // Changed @@ -39,6 +38,7 @@ func (o *ImportOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_list_options.go b/pkg/bindings/images/types_list_options.go index 209d72e34..5dc4242fc 100644 --- a/pkg/bindings/images/types_list_options.go +++ b/pkg/bindings/images/types_list_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:26.462967928 -0600 CST m=+0.000289760 */ // Changed @@ -39,6 +38,7 @@ func (o *ListOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_load_options.go b/pkg/bindings/images/types_load_options.go index 6bba573d4..7bbd56c09 100644 --- a/pkg/bindings/images/types_load_options.go +++ b/pkg/bindings/images/types_load_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:27.031848205 -0600 CST m=+0.000279409 */ // Changed @@ -39,6 +38,7 @@ func (o *LoadOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_prune_options.go b/pkg/bindings/images/types_prune_options.go index c29fdae12..c290bb379 100644 --- a/pkg/bindings/images/types_prune_options.go +++ b/pkg/bindings/images/types_prune_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:27.316938584 -0600 CST m=+0.000239843 */ // Changed @@ -39,6 +38,7 @@ func (o *PruneOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_pull_options.go b/pkg/bindings/images/types_pull_options.go index 07f3e079d..5163a6341 100644 --- a/pkg/bindings/images/types_pull_options.go +++ b/pkg/bindings/images/types_pull_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" "github.com/containers/common/pkg/config" jsoniter "github.com/json-iterator/go" @@ -12,8 +13,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:28.164648348 -0600 CST m=+0.000243264 */ // Changed @@ -40,6 +39,7 @@ func (o *PullOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_push_options.go b/pkg/bindings/images/types_push_options.go index f9ce1b835..15210f30b 100644 --- a/pkg/bindings/images/types_push_options.go +++ b/pkg/bindings/images/types_push_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:27.881232044 -0600 CST m=+0.000242458 */ // Changed @@ -39,6 +38,7 @@ func (o *PushOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_remove_options.go b/pkg/bindings/images/types_remove_options.go index c9692c2b7..66a6bea7d 100644 --- a/pkg/bindings/images/types_remove_options.go +++ b/pkg/bindings/images/types_remove_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:26.180391541 -0600 CST m=+0.000290244 */ // Changed @@ -39,6 +38,7 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_search_options.go b/pkg/bindings/images/types_search_options.go index e6168ac33..299d27505 100644 --- a/pkg/bindings/images/types_search_options.go +++ b/pkg/bindings/images/types_search_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:28.023569573 -0600 CST m=+0.000245548 */ // Changed @@ -39,6 +38,7 @@ func (o *SearchOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_tag_options.go b/pkg/bindings/images/types_tag_options.go index f6396e590..40cd4a35b 100644 --- a/pkg/bindings/images/types_tag_options.go +++ b/pkg/bindings/images/types_tag_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:27.457906682 -0600 CST m=+0.000245071 */ // Changed @@ -39,6 +38,7 @@ func (o *TagOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_tree_options.go b/pkg/bindings/images/types_tree_options.go index fb2493f85..a671fa4e0 100644 --- a/pkg/bindings/images/types_tree_options.go +++ b/pkg/bindings/images/types_tree_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:26.749625305 -0600 CST m=+0.000267624 */ // Changed @@ -39,6 +38,7 @@ func (o *TreeOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/images/types_untag_options.go b/pkg/bindings/images/types_untag_options.go index 8faf5c14e..e38c5f18e 100644 --- a/pkg/bindings/images/types_untag_options.go +++ b/pkg/bindings/images/types_untag_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:27.600379913 -0600 CST m=+0.000251449 */ // Changed @@ -39,6 +38,7 @@ func (o *UntagOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/manifests/types_add_options.go b/pkg/bindings/manifests/types_add_options.go index d45effedc..1e588c668 100644 --- a/pkg/bindings/manifests/types_add_options.go +++ b/pkg/bindings/manifests/types_add_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:57:55.92237379 -0600 CST m=+0.000150701 */ // Changed @@ -39,6 +38,7 @@ func (o *AddOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/manifests/types_create_options.go b/pkg/bindings/manifests/types_create_options.go index da07f1abf..3a564a92b 100644 --- a/pkg/bindings/manifests/types_create_options.go +++ b/pkg/bindings/manifests/types_create_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:57:55.784206871 -0600 CST m=+0.000157049 */ // Changed @@ -39,6 +38,7 @@ func (o *CreateOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/manifests/types_inspect_options.go b/pkg/bindings/manifests/types_inspect_options.go index 0d32d5bb9..2af4190d4 100644 --- a/pkg/bindings/manifests/types_inspect_options.go +++ b/pkg/bindings/manifests/types_inspect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:57:55.631746481 -0600 CST m=+0.000143104 */ // Changed @@ -39,6 +38,7 @@ func (o *InspectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/manifests/types_push_options.go b/pkg/bindings/manifests/types_push_options.go index 4226733c9..1d689f699 100644 --- a/pkg/bindings/manifests/types_push_options.go +++ b/pkg/bindings/manifests/types_push_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:57:56.197438009 -0600 CST m=+0.000149060 */ // Changed @@ -39,6 +38,7 @@ func (o *PushOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/manifests/types_remove_options.go b/pkg/bindings/manifests/types_remove_options.go index f99220f6c..3b35c38b8 100644 --- a/pkg/bindings/manifests/types_remove_options.go +++ b/pkg/bindings/manifests/types_remove_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:57:56.059954408 -0600 CST m=+0.000146015 */ // Changed @@ -39,6 +38,7 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/network/types_connect_options.go b/pkg/bindings/network/types_connect_options.go index 6fcc4536e..b6081ba57 100644 --- a/pkg/bindings/network/types_connect_options.go +++ b/pkg/bindings/network/types_connect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:34.075822786 -0600 CST m=+0.000167237 */ // Changed @@ -39,6 +38,7 @@ func (o *ConnectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/network/types_create_options.go b/pkg/bindings/network/types_create_options.go index daec6a254..5b0abe870 100644 --- a/pkg/bindings/network/types_create_options.go +++ b/pkg/bindings/network/types_create_options.go @@ -5,6 +5,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -12,8 +13,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:33.37307678 -0600 CST m=+0.000176739 */ // Changed @@ -40,6 +39,7 @@ func (o *CreateOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() @@ -193,9 +193,9 @@ func (o *CreateOptions) WithIPRange(value net.IPNet) *CreateOptions { // GetIPRange func (o *CreateOptions) GetIPRange() net.IPNet { - var ipRange net.IPNet + var iPRange net.IPNet if o.IPRange == nil { - return ipRange + return iPRange } return *o.IPRange } diff --git a/pkg/bindings/network/types_disconnect_options.go b/pkg/bindings/network/types_disconnect_options.go index 821279976..8b2a9cb71 100644 --- a/pkg/bindings/network/types_disconnect_options.go +++ b/pkg/bindings/network/types_disconnect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:33.936088242 -0600 CST m=+0.000168680 */ // Changed @@ -39,6 +38,7 @@ func (o *DisconnectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/network/types_inspect_options.go b/pkg/bindings/network/types_inspect_options.go index 7704904ce..cec5ef7b2 100644 --- a/pkg/bindings/network/types_inspect_options.go +++ b/pkg/bindings/network/types_inspect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:33.520438264 -0600 CST m=+0.000172934 */ // Changed @@ -39,6 +38,7 @@ func (o *InspectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/network/types_list_options.go b/pkg/bindings/network/types_list_options.go index bbd2a71db..6a33fb7b6 100644 --- a/pkg/bindings/network/types_list_options.go +++ b/pkg/bindings/network/types_list_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:33.796794129 -0600 CST m=+0.000180368 */ // Changed @@ -39,6 +38,7 @@ func (o *ListOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/network/types_remove_options.go b/pkg/bindings/network/types_remove_options.go index b24835ae4..861fe1f2c 100644 --- a/pkg/bindings/network/types_remove_options.go +++ b/pkg/bindings/network/types_remove_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:33.658228151 -0600 CST m=+0.000172527 */ // Changed @@ -39,6 +38,7 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/play/types_kube_options.go b/pkg/bindings/play/types_kube_options.go index 91cdd30aa..5aec4b479 100644 --- a/pkg/bindings/play/types_kube_options.go +++ b/pkg/bindings/play/types_kube_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:02.386833736 -0600 CST m=+0.000171080 */ // Changed @@ -39,6 +38,7 @@ func (o *KubeOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_create_options.go b/pkg/bindings/pods/types_create_options.go index b6cf0fc53..b501d1151 100644 --- a/pkg/bindings/pods/types_create_options.go +++ b/pkg/bindings/pods/types_create_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:40.05490508 -0600 CST m=+0.000156396 */ // Changed @@ -39,6 +38,7 @@ func (o *CreateOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_inspect_options.go b/pkg/bindings/pods/types_inspect_options.go index 1c881ce9c..a2eb25fef 100644 --- a/pkg/bindings/pods/types_inspect_options.go +++ b/pkg/bindings/pods/types_inspect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:40.258801519 -0600 CST m=+0.000175055 */ // Changed @@ -39,6 +38,7 @@ func (o *InspectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_kill_options.go b/pkg/bindings/pods/types_kill_options.go index cb5bdfd01..f9cad3579 100644 --- a/pkg/bindings/pods/types_kill_options.go +++ b/pkg/bindings/pods/types_kill_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:40.398857339 -0600 CST m=+0.000160135 */ // Changed @@ -39,6 +38,7 @@ func (o *KillOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_list_options.go b/pkg/bindings/pods/types_list_options.go index d095bf3db..02e7adf2d 100644 --- a/pkg/bindings/pods/types_list_options.go +++ b/pkg/bindings/pods/types_list_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:40.818123838 -0600 CST m=+0.000164328 */ // Changed @@ -39,6 +38,7 @@ func (o *ListOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_pause_options.go b/pkg/bindings/pods/types_pause_options.go index 06ee6f81d..2e4fdb4a6 100644 --- a/pkg/bindings/pods/types_pause_options.go +++ b/pkg/bindings/pods/types_pause_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:40.538407099 -0600 CST m=+0.000193274 */ // Changed @@ -39,6 +38,7 @@ func (o *PauseOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_prune_options.go b/pkg/bindings/pods/types_prune_options.go index 6610aa7cc..616ad6dc9 100644 --- a/pkg/bindings/pods/types_prune_options.go +++ b/pkg/bindings/pods/types_prune_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:40.678507342 -0600 CST m=+0.000183891 */ // Changed @@ -39,6 +38,7 @@ func (o *PruneOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_remove_options.go b/pkg/bindings/pods/types_remove_options.go index 8f18e43c9..6960d8839 100644 --- a/pkg/bindings/pods/types_remove_options.go +++ b/pkg/bindings/pods/types_remove_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:41.80320679 -0600 CST m=+0.000158149 */ // Changed @@ -39,6 +38,7 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_restart_options.go b/pkg/bindings/pods/types_restart_options.go index 9030de1e7..427833044 100644 --- a/pkg/bindings/pods/types_restart_options.go +++ b/pkg/bindings/pods/types_restart_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:40.958315383 -0600 CST m=+0.000168360 */ // Changed @@ -39,6 +38,7 @@ func (o *RestartOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_start_options.go b/pkg/bindings/pods/types_start_options.go index 0fce21099..e98798459 100644 --- a/pkg/bindings/pods/types_start_options.go +++ b/pkg/bindings/pods/types_start_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:41.099102916 -0600 CST m=+0.000159629 */ // Changed @@ -39,6 +38,7 @@ func (o *StartOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_stats_options.go b/pkg/bindings/pods/types_stats_options.go index d38a9a115..845a534a3 100644 --- a/pkg/bindings/pods/types_stats_options.go +++ b/pkg/bindings/pods/types_stats_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:41.658228243 -0600 CST m=+0.000160769 */ // Changed @@ -39,6 +38,7 @@ func (o *StatsOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_stop_options.go b/pkg/bindings/pods/types_stop_options.go index ac698b8c5..86000eb57 100644 --- a/pkg/bindings/pods/types_stop_options.go +++ b/pkg/bindings/pods/types_stop_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:41.237892781 -0600 CST m=+0.000155040 */ // Changed @@ -39,6 +38,7 @@ func (o *StopOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_top_options.go b/pkg/bindings/pods/types_top_options.go index 895f62957..ada0b1e25 100644 --- a/pkg/bindings/pods/types_top_options.go +++ b/pkg/bindings/pods/types_top_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:41.375876994 -0600 CST m=+0.000154839 */ // Changed @@ -39,6 +38,7 @@ func (o *TopOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/pods/types_unpause_options.go b/pkg/bindings/pods/types_unpause_options.go index 3d647cf25..6a9ee8fcd 100644 --- a/pkg/bindings/pods/types_unpause_options.go +++ b/pkg/bindings/pods/types_unpause_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:41.515225789 -0600 CST m=+0.000158667 */ // Changed @@ -39,6 +38,7 @@ func (o *UnpauseOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/system/types_disk_options.go b/pkg/bindings/system/types_disk_options.go index f7d2cca06..c5eb2f94c 100644 --- a/pkg/bindings/system/types_disk_options.go +++ b/pkg/bindings/system/types_disk_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:08.087362343 -0600 CST m=+0.000150636 */ // Changed @@ -39,6 +38,7 @@ func (o *DiskOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/system/types_events_options.go b/pkg/bindings/system/types_events_options.go index 6dd64b055..2e95339e6 100644 --- a/pkg/bindings/system/types_events_options.go +++ b/pkg/bindings/system/types_events_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:07.675150173 -0600 CST m=+0.000140977 */ // Changed @@ -39,6 +38,7 @@ func (o *EventsOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/system/types_info_options.go b/pkg/bindings/system/types_info_options.go index 3a8960e1b..263513b0f 100644 --- a/pkg/bindings/system/types_info_options.go +++ b/pkg/bindings/system/types_info_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:08.233760126 -0600 CST m=+0.000142369 */ // Changed @@ -39,6 +38,7 @@ func (o *InfoOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/system/types_prune_options.go b/pkg/bindings/system/types_prune_options.go index 2cd3c8000..a9a6a6cda 100644 --- a/pkg/bindings/system/types_prune_options.go +++ b/pkg/bindings/system/types_prune_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:07.812719858 -0600 CST m=+0.000143214 */ // Changed @@ -39,6 +38,7 @@ func (o *PruneOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/system/types_version_options.go b/pkg/bindings/system/types_version_options.go index 4974e8d8f..be07581fa 100644 --- a/pkg/bindings/system/types_version_options.go +++ b/pkg/bindings/system/types_version_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:07.950759332 -0600 CST m=+0.000140376 */ // Changed @@ -39,6 +38,7 @@ func (o *VersionOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/test/common_test.go b/pkg/bindings/test/common_test.go index 232d7136f..c2b1347d2 100644 --- a/pkg/bindings/test/common_test.go +++ b/pkg/bindings/test/common_test.go @@ -182,7 +182,7 @@ func (b *bindingTest) RestoreImagesFromCache() { } } func (b *bindingTest) restoreImageFromCache(i testImage) { - p := b.runPodman([]string{"load", "-i", filepath.Join(ImageCacheDir, i.tarballName), i.name}) + p := b.runPodman([]string{"load", "-i", filepath.Join(ImageCacheDir, i.tarballName)}) p.Wait(45) } diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go index 2ab5e45d0..fa601e7e5 100644 --- a/pkg/bindings/test/containers_test.go +++ b/pkg/bindings/test/containers_test.go @@ -8,6 +8,7 @@ import ( "github.com/containers/podman/v2/libpod/define" "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/bindings/containers" + "github.com/containers/podman/v2/pkg/domain/entities/reports" "github.com/containers/podman/v2/pkg/specgen" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -533,8 +534,8 @@ var _ = Describe("Podman containers ", func() { // Prune container should return no errors and one pruned container ID. pruneResponse, err := containers.Prune(bt.conn, nil) Expect(err).To(BeNil()) - Expect(len(pruneResponse.Err)).To(Equal(0)) - Expect(len(pruneResponse.ID)).To(Equal(1)) + Expect(len(reports.PruneReportsErrs(pruneResponse))).To(Equal(0)) + Expect(len(reports.PruneReportsIds(pruneResponse))).To(Equal(1)) }) It("podman prune stopped containers with filters", func() { @@ -558,8 +559,8 @@ var _ = Describe("Podman containers ", func() { } pruneResponse, err = containers.Prune(bt.conn, new(containers.PruneOptions).WithFilters(filtersIncorrect)) Expect(err).To(BeNil()) - Expect(len(pruneResponse.Err)).To(Equal(0)) - Expect(len(pruneResponse.ID)).To(Equal(0)) + Expect(len(reports.PruneReportsIds(pruneResponse))).To(Equal(0)) + Expect(len(reports.PruneReportsErrs(pruneResponse))).To(Equal(0)) // Valid filter params container should be pruned now. filters := map[string][]string{ @@ -567,8 +568,8 @@ var _ = Describe("Podman containers ", func() { } pruneResponse, err = containers.Prune(bt.conn, new(containers.PruneOptions).WithFilters(filters)) Expect(err).To(BeNil()) - Expect(len(pruneResponse.Err)).To(Equal(0)) - Expect(len(pruneResponse.ID)).To(Equal(1)) + Expect(len(reports.PruneReportsErrs(pruneResponse))).To(Equal(0)) + Expect(len(reports.PruneReportsIds(pruneResponse))).To(Equal(1)) }) It("podman prune running containers", func() { @@ -585,7 +586,7 @@ var _ = Describe("Podman containers ", func() { // Prune. Should return no error no prune response ID. pruneResponse, err := containers.Prune(bt.conn, nil) Expect(err).To(BeNil()) - Expect(len(pruneResponse.ID)).To(Equal(0)) + Expect(len(pruneResponse)).To(Equal(0)) }) It("podman inspect bogus container", func() { diff --git a/pkg/bindings/test/images_test.go b/pkg/bindings/test/images_test.go index e178f4219..81959e813 100644 --- a/pkg/bindings/test/images_test.go +++ b/pkg/bindings/test/images_test.go @@ -9,6 +9,7 @@ import ( "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/bindings/containers" "github.com/containers/podman/v2/pkg/bindings/images" + dreports "github.com/containers/podman/v2/pkg/domain/entities/reports" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" @@ -218,7 +219,7 @@ var _ = Describe("Podman images", func() { f, err := os.Open(filepath.Join(ImageCacheDir, alpine.tarballName)) defer f.Close() Expect(err).To(BeNil()) - names, err := images.Load(bt.conn, f, nil) + names, err := images.Load(bt.conn, f) Expect(err).To(BeNil()) Expect(names.Names[0]).To(Equal(alpine.name)) exists, err = images.Exists(bt.conn, alpine.name) @@ -233,14 +234,9 @@ var _ = Describe("Podman images", func() { exists, err = images.Exists(bt.conn, alpine.name) Expect(err).To(BeNil()) Expect(exists).To(BeFalse()) - newName := "quay.io/newname:fizzle" - options := new(images.LoadOptions).WithReference(newName) - names, err = images.Load(bt.conn, f, options) + names, err = images.Load(bt.conn, f) Expect(err).To(BeNil()) Expect(names.Names[0]).To(Equal(alpine.name)) - exists, err = images.Exists(bt.conn, newName) - Expect(err).To(BeNil()) - Expect(exists).To(BeTrue()) // load with a bad repo name should trigger a 500 f, err = os.Open(filepath.Join(ImageCacheDir, alpine.tarballName)) @@ -250,11 +246,6 @@ var _ = Describe("Podman images", func() { exists, err = images.Exists(bt.conn, alpine.name) Expect(err).To(BeNil()) Expect(exists).To(BeFalse()) - options = new(images.LoadOptions).WithReference("quay.io/newName:fizzle") - _, err = images.Load(bt.conn, f, options) - Expect(err).ToNot(BeNil()) - code, _ := bindings.CheckResponseCode(err) - Expect(code).To(BeNumerically("==", http.StatusInternalServerError)) }) It("Export Image", func() { @@ -355,7 +346,7 @@ var _ = Describe("Podman images", func() { results, err := images.Prune(bt.conn, options) Expect(err).NotTo(HaveOccurred()) Expect(len(results)).To(BeNumerically(">", 0)) - Expect(results).To(ContainElement("docker.io/library/alpine:latest")) + Expect(dreports.PruneReportsIds(results)).To(ContainElement("docker.io/library/alpine:latest")) }) // TODO: we really need to extent to pull tests once we have a more sophisticated CI. diff --git a/pkg/bindings/test/system_test.go b/pkg/bindings/test/system_test.go index 25fda5575..44067b61d 100644 --- a/pkg/bindings/test/system_test.go +++ b/pkg/bindings/test/system_test.go @@ -10,6 +10,7 @@ import ( "github.com/containers/podman/v2/pkg/bindings/system" "github.com/containers/podman/v2/pkg/bindings/volumes" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/entities/reports" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" @@ -80,12 +81,12 @@ var _ = Describe("Podman system", func() { systemPruneResponse, err := system.Prune(bt.conn, options) Expect(err).To(BeNil()) Expect(len(systemPruneResponse.PodPruneReport)).To(Equal(1)) - Expect(len(systemPruneResponse.ContainerPruneReport.ID)).To(Equal(1)) - Expect(len(systemPruneResponse.ImagePruneReport.Report.Id)). + Expect(len(systemPruneResponse.ContainerPruneReports)).To(Equal(1)) + Expect(len(systemPruneResponse.ImagePruneReports)). To(BeNumerically(">", 0)) - Expect(systemPruneResponse.ImagePruneReport.Report.Id). + Expect(reports.PruneReportsIds(systemPruneResponse.ImagePruneReports)). To(ContainElement("docker.io/library/alpine:latest")) - Expect(len(systemPruneResponse.VolumePruneReport)).To(Equal(0)) + Expect(len(systemPruneResponse.VolumePruneReports)).To(Equal(0)) }) It("podman system prune running alpine container", func() { @@ -114,14 +115,14 @@ var _ = Describe("Podman system", func() { systemPruneResponse, err := system.Prune(bt.conn, options) Expect(err).To(BeNil()) Expect(len(systemPruneResponse.PodPruneReport)).To(Equal(1)) - Expect(len(systemPruneResponse.ContainerPruneReport.ID)).To(Equal(1)) - Expect(len(systemPruneResponse.ImagePruneReport.Report.Id)). + Expect(len(systemPruneResponse.ContainerPruneReports)).To(Equal(1)) + Expect(len(systemPruneResponse.ImagePruneReports)). To(BeNumerically(">", 0)) // Alpine image should not be pruned as used by running container - Expect(systemPruneResponse.ImagePruneReport.Report.Id). + Expect(reports.PruneReportsIds(systemPruneResponse.ImagePruneReports)). ToNot(ContainElement("docker.io/library/alpine:latest")) // Though unused volume is available it should not be pruned as flag set to false. - Expect(len(systemPruneResponse.VolumePruneReport)).To(Equal(0)) + Expect(len(systemPruneResponse.VolumePruneReports)).To(Equal(0)) }) It("podman system prune running alpine container volume prune", func() { @@ -149,14 +150,14 @@ var _ = Describe("Podman system", func() { systemPruneResponse, err := system.Prune(bt.conn, options) Expect(err).To(BeNil()) Expect(len(systemPruneResponse.PodPruneReport)).To(Equal(0)) - Expect(len(systemPruneResponse.ContainerPruneReport.ID)).To(Equal(1)) - Expect(len(systemPruneResponse.ImagePruneReport.Report.Id)). + Expect(len(systemPruneResponse.ContainerPruneReports)).To(Equal(1)) + Expect(len(systemPruneResponse.ImagePruneReports)). To(BeNumerically(">", 0)) // Alpine image should not be pruned as used by running container - Expect(systemPruneResponse.ImagePruneReport.Report.Id). + Expect(reports.PruneReportsIds(systemPruneResponse.ImagePruneReports)). ToNot(ContainElement("docker.io/library/alpine:latest")) // Volume should be pruned now as flag set true - Expect(len(systemPruneResponse.VolumePruneReport)).To(Equal(1)) + Expect(len(systemPruneResponse.VolumePruneReports)).To(Equal(1)) }) It("podman system prune running alpine container volume prune --filter", func() { @@ -197,14 +198,14 @@ var _ = Describe("Podman system", func() { // This check **should** be "Equal(0)" since we are passing label // filters however the Prune function doesn't seem to pass filters // to each component. - Expect(len(systemPruneResponse.ContainerPruneReport.ID)).To(Equal(1)) - Expect(len(systemPruneResponse.ImagePruneReport.Report.Id)). + Expect(len(systemPruneResponse.ContainerPruneReports)).To(Equal(1)) + Expect(len(systemPruneResponse.ImagePruneReports)). To(BeNumerically(">", 0)) // Alpine image should not be pruned as used by running container - Expect(systemPruneResponse.ImagePruneReport.Report.Id). + Expect(reports.PruneReportsIds(systemPruneResponse.ImagePruneReports)). ToNot(ContainElement("docker.io/library/alpine:latest")) // Volume shouldn't be pruned because the PruneOptions filters doesn't match - Expect(len(systemPruneResponse.VolumePruneReport)).To(Equal(0)) + Expect(len(systemPruneResponse.VolumePruneReports)).To(Equal(0)) // Fix filter and re prune f["label"] = []string{"label1=value1"} @@ -213,6 +214,6 @@ var _ = Describe("Podman system", func() { Expect(err).To(BeNil()) // Volume should be pruned because the PruneOptions filters now match - Expect(len(systemPruneResponse.VolumePruneReport)).To(Equal(1)) + Expect(len(systemPruneResponse.VolumePruneReports)).To(Equal(1)) }) }) diff --git a/pkg/bindings/test/volumes_test.go b/pkg/bindings/test/volumes_test.go index e0d854b66..1f1da3cfa 100644 --- a/pkg/bindings/test/volumes_test.go +++ b/pkg/bindings/test/volumes_test.go @@ -10,6 +10,7 @@ import ( "github.com/containers/podman/v2/pkg/bindings/containers" "github.com/containers/podman/v2/pkg/bindings/volumes" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/entities/reports" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" @@ -166,7 +167,7 @@ var _ = Describe("Podman volumes", func() { session.Wait(45) vols, err = volumes.Prune(connText, nil) Expect(err).To(BeNil()) - Expect(len(vols)).To(BeNumerically("==", 1)) + Expect(len(reports.PruneReportsIds(vols))).To(BeNumerically("==", 1)) _, err = volumes.Inspect(connText, "homer", nil) Expect(err).To(BeNil()) diff --git a/pkg/bindings/volumes/types_create_options.go b/pkg/bindings/volumes/types_create_options.go index 80bdac2d2..171090afe 100644 --- a/pkg/bindings/volumes/types_create_options.go +++ b/pkg/bindings/volumes/types_create_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:14.043860791 -0600 CST m=+0.000188944 */ // Changed @@ -39,6 +38,7 @@ func (o *CreateOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/volumes/types_inspect_options.go b/pkg/bindings/volumes/types_inspect_options.go index ba8c70b63..3a1d396a7 100644 --- a/pkg/bindings/volumes/types_inspect_options.go +++ b/pkg/bindings/volumes/types_inspect_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:14.189902005 -0600 CST m=+0.000151439 */ // Changed @@ -39,6 +38,7 @@ func (o *InspectOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/volumes/types_list_options.go b/pkg/bindings/volumes/types_list_options.go index 99dec132c..56033a575 100644 --- a/pkg/bindings/volumes/types_list_options.go +++ b/pkg/bindings/volumes/types_list_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:14.326721724 -0600 CST m=+0.000172471 */ // Changed @@ -39,6 +38,7 @@ func (o *ListOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/volumes/types_prune_options.go b/pkg/bindings/volumes/types_prune_options.go index cdbc03fc9..c043d69d0 100644 --- a/pkg/bindings/volumes/types_prune_options.go +++ b/pkg/bindings/volumes/types_prune_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:14.463307398 -0600 CST m=+0.000180868 */ // Changed @@ -39,6 +38,7 @@ func (o *PruneOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/volumes/types_remove_options.go b/pkg/bindings/volumes/types_remove_options.go index 923d1353c..1f8ba4e22 100644 --- a/pkg/bindings/volumes/types_remove_options.go +++ b/pkg/bindings/volumes/types_remove_options.go @@ -4,6 +4,7 @@ import ( "net/url" "reflect" "strconv" + "strings" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" @@ -11,8 +12,6 @@ import ( /* This file is generated automatically by go generate. Do not edit. - -Created 2020-12-18 15:58:14.60278922 -0600 CST m=+0.000134408 */ // Changed @@ -39,6 +38,7 @@ func (o *RemoveOptions) ToParams() (url.Values, error) { if !o.Changed(fieldName) { continue } + fieldName = strings.ToLower(fieldName) f := s.Field(i) if reflect.Ptr == f.Kind() { f = f.Elem() diff --git a/pkg/bindings/volumes/volumes.go b/pkg/bindings/volumes/volumes.go index 626f52d39..fe081eb46 100644 --- a/pkg/bindings/volumes/volumes.go +++ b/pkg/bindings/volumes/volumes.go @@ -7,6 +7,7 @@ import ( "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/entities/reports" jsoniter "github.com/json-iterator/go" ) @@ -77,9 +78,9 @@ func List(ctx context.Context, options *ListOptions) ([]*entities.VolumeListRepo } // Prune removes unused volumes from the local filesystem. -func Prune(ctx context.Context, options *PruneOptions) ([]*entities.VolumePruneReport, error) { +func Prune(ctx context.Context, options *PruneOptions) ([]*reports.PruneReport, error) { var ( - pruned []*entities.VolumePruneReport + pruned []*reports.PruneReport ) conn, err := bindings.GetClient(ctx) if err != nil { |