summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/manifest.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-12-14 11:33:25 -0600
committerbaude <bbaude@redhat.com>2020-12-17 09:40:51 -0600
commit86335aa4ae01dadecd36468409d742e68b76925d (patch)
treefd6e5bfeb924db9020073685d0133b2fa38622c1 /pkg/domain/infra/abi/manifest.go
parentc38ae47a1adf3235d8b01d724e7327e608dd8078 (diff)
downloadpodman-86335aa4ae01dadecd36468409d742e68b76925d.tar.gz
podman-86335aa4ae01dadecd36468409d742e68b76925d.tar.bz2
podman-86335aa4ae01dadecd36468409d742e68b76925d.zip
misc bindings to podman v3
manifest, system, info, volumes, play, and generate bindings are updated to always have binding options. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/manifest.go')
-rw-r--r--pkg/domain/infra/abi/manifest.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go
index 600d64b1d..0c734d10d 100644
--- a/pkg/domain/infra/abi/manifest.go
+++ b/pkg/domain/infra/abi/manifest.go
@@ -244,15 +244,16 @@ func (ir *ImageEngine) ManifestRemove(ctx context.Context, names []string) (stri
}
// ManifestPush pushes a manifest list or image index to the destination
-func (ir *ImageEngine) ManifestPush(ctx context.Context, names []string, opts entities.ManifestPushOptions) error {
- listImage, err := ir.Libpod.ImageRuntime().NewFromLocal(names[0])
+func (ir *ImageEngine) ManifestPush(ctx context.Context, name, destination string, opts entities.ManifestPushOptions) error {
+ listImage, err := ir.Libpod.ImageRuntime().NewFromLocal(name)
if err != nil {
- return errors.Wrapf(err, "error retrieving local image from image name %s", names[0])
+ return errors.Wrapf(err, "error retrieving local image from image name %s", name)
}
- dest, err := alltransports.ParseImageName(names[1])
+ dest, err := alltransports.ParseImageName(destination)
if err != nil {
return err
}
+
var manifestType string
if opts.Format != "" {
switch opts.Format {
@@ -267,8 +268,8 @@ func (ir *ImageEngine) ManifestPush(ctx context.Context, names []string, opts en
// Set the system context.
sys := ir.Libpod.SystemContext()
- if sys != nil {
- sys = &types.SystemContext{}
+ if sys == nil {
+ sys = new(types.SystemContext)
}
sys.AuthFilePath = opts.Authfile
sys.DockerInsecureSkipTLSVerify = opts.SkipTLSVerify
@@ -296,12 +297,12 @@ func (ir *ImageEngine) ManifestPush(ctx context.Context, names []string, opts en
if !opts.Quiet {
options.ReportWriter = os.Stderr
}
- digest, err := listImage.PushManifest(dest, options)
+ manDigest, err := listImage.PushManifest(dest, options)
if err == nil && opts.Purge {
_, err = ir.Libpod.GetStore().DeleteImage(listImage.ID(), true)
}
if opts.DigestFile != "" {
- if err = ioutil.WriteFile(opts.DigestFile, []byte(digest.String()), 0644); err != nil {
+ if err = ioutil.WriteFile(opts.DigestFile, []byte(manDigest.String()), 0644); err != nil {
return buildahUtil.GetFailureCause(err, errors.Wrapf(err, "failed to write digest to file %q", opts.DigestFile))
}
}