diff options
author | Matej Vasek <mvasek@redhat.com> | 2021-06-28 21:17:13 +0200 |
---|---|---|
committer | Matej Vasek <mvasek@redhat.com> | 2021-07-01 12:01:46 +0200 |
commit | 86c6014145d5b8d4ea51f338beb9bddaa8b5a334 (patch) | |
tree | 056769253cf35f00bdd46389bddd9c076c31a00e /pkg/bindings/internal/util | |
parent | fd1715568b7c14451dcf2581c385c8d3e307d30e (diff) | |
download | podman-86c6014145d5b8d4ea51f338beb9bddaa8b5a334.tar.gz podman-86c6014145d5b8d4ea51f338beb9bddaa8b5a334.tar.bz2 podman-86c6014145d5b8d4ea51f338beb9bddaa8b5a334.zip |
Implement --archive flag for podman cp
Signed-off-by: Matej Vasek <mvasek@redhat.com>
Diffstat (limited to 'pkg/bindings/internal/util')
-rw-r--r-- | pkg/bindings/internal/util/util.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/bindings/internal/util/util.go b/pkg/bindings/internal/util/util.go index ef93d6e25..bcf6959f2 100644 --- a/pkg/bindings/internal/util/util.go +++ b/pkg/bindings/internal/util/util.go @@ -72,14 +72,18 @@ func ToParams(o interface{}) (url.Values, error) { if reflect.Ptr == f.Kind() { f = f.Elem() } + paramName := fieldName + if pn, ok := sType.Field(i).Tag.Lookup("schema"); ok { + paramName = pn + } switch { case IsSimpleType(f): - params.Set(fieldName, SimpleTypeToParam(f)) + params.Set(paramName, SimpleTypeToParam(f)) case f.Kind() == reflect.Slice: for i := 0; i < f.Len(); i++ { elem := f.Index(i) if IsSimpleType(elem) { - params.Add(fieldName, SimpleTypeToParam(elem)) + params.Add(paramName, SimpleTypeToParam(elem)) } else { return nil, errors.New("slices must contain only simple types") } @@ -95,7 +99,7 @@ func ToParams(o interface{}) (url.Values, error) { return nil, err } - params.Set(fieldName, s) + params.Set(paramName, s) } } return params, nil |