diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-17 06:52:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-17 06:52:35 -0500 |
commit | 341c4b1fd94dda26be5ce588490e3d7284a54dbb (patch) | |
tree | 82f8c6bfa113b8b350aa069e81436b88bddf3080 /pkg/bindings/manifests/manifests.go | |
parent | 73b036db566a8f3606f0b376728efe03fcf8685d (diff) | |
parent | cf51c7ed9f955390a0e417f208046e0b8fbadb26 (diff) | |
download | podman-341c4b1fd94dda26be5ce588490e3d7284a54dbb.tar.gz podman-341c4b1fd94dda26be5ce588490e3d7284a54dbb.tar.bz2 podman-341c4b1fd94dda26be5ce588490e3d7284a54dbb.zip |
Merge pull request #8942 from rhatdan/push
Allow podman push to push manifest lists
Diffstat (limited to 'pkg/bindings/manifests/manifests.go')
-rw-r--r-- | pkg/bindings/manifests/manifests.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go index ef4e2a908..b6db64b02 100644 --- a/pkg/bindings/manifests/manifests.go +++ b/pkg/bindings/manifests/manifests.go @@ -5,11 +5,13 @@ import ( "errors" "net/http" "net/url" + "strconv" "strings" "github.com/containers/image/v5/manifest" "github.com/containers/podman/v2/pkg/api/handlers" "github.com/containers/podman/v2/pkg/bindings" + "github.com/containers/podman/v2/pkg/bindings/images" jsoniter "github.com/json-iterator/go" ) @@ -112,12 +114,12 @@ func Remove(ctx context.Context, name, digest string, options *RemoveOptions) (s // Push takes a manifest list and pushes to a destination. If the destination is not specified, // the name will be used instead. If the optional all boolean is specified, all images specified // in the list will be pushed as well. -func Push(ctx context.Context, name, destination string, options *PushOptions) (string, error) { +func Push(ctx context.Context, name, destination string, options *images.PushOptions) (string, error) { var ( idr handlers.IDResponse ) if options == nil { - options = new(PushOptions) + options = new(images.PushOptions) } if len(destination) < 1 { destination = name @@ -130,8 +132,15 @@ func Push(ctx context.Context, name, destination string, options *PushOptions) ( if err != nil { return "", err } + //SkipTLSVerify is special. We need to delete the param added by + //toparams and change the key and flip the bool + if options.SkipTLSVerify != nil { + params.Del("SkipTLSVerify") + params.Set("tlsVerify", strconv.FormatBool(!options.GetSkipTLSVerify())) + } params.Set("image", name) params.Set("destination", destination) + params.Set("format", *options.Format) _, err = conn.DoRequest(nil, http.MethodPost, "/manifests/%s/push", params, nil, name) if err != nil { return "", err |