diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-09-29 14:15:37 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-09-29 14:16:42 +0200 |
commit | e2fe9eabac61c4d5e1e9095c2cac1982409371d4 (patch) | |
tree | 8da0d9ff7a7a985f3ecd9de5c13190186c1f6839 /pkg/domain/infra | |
parent | f52feded3ce6c1ad2af046ab774fbc2b9c832487 (diff) | |
download | podman-e2fe9eabac61c4d5e1e9095c2cac1982409371d4.tar.gz podman-e2fe9eabac61c4d5e1e9095c2cac1982409371d4.tar.bz2 podman-e2fe9eabac61c4d5e1e9095c2cac1982409371d4.zip |
Revert "remote: fix manifest add --annotation"
This reverts commit 32f54a81ed797597827123b671b6e73194354327.
`pkg/bindings` is supported outside of podman and we have to keep it
stable.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/tunnel/manifest.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pkg/domain/infra/tunnel/manifest.go b/pkg/domain/infra/tunnel/manifest.go index 2fe43aad0..696d0a963 100644 --- a/pkg/domain/infra/tunnel/manifest.go +++ b/pkg/domain/infra/tunnel/manifest.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "strings" "github.com/containers/image/v5/types" "github.com/containers/podman/v4/pkg/bindings/images" @@ -47,9 +48,20 @@ func (ir *ImageEngine) ManifestInspect(_ context.Context, name string) ([]byte, // ManifestAdd adds images to the manifest list func (ir *ImageEngine) ManifestAdd(_ context.Context, name string, imageNames []string, opts entities.ManifestAddOptions) (string, error) { - options := new(manifests.AddOptions).WithAll(opts.All).WithAnnotation(opts.Annotation).WithArch(opts.Arch) - options.WithVariant(opts.Variant).WithFeatures(opts.Features).WithImages(imageNames).WithOS(opts.OS) - options.WithOSVersion(opts.OSVersion).WithUsername(opts.Username).WithPassword(opts.Password).WithAuthfile(opts.Authfile) + options := new(manifests.AddOptions).WithAll(opts.All).WithArch(opts.Arch).WithVariant(opts.Variant) + options.WithFeatures(opts.Features).WithImages(imageNames).WithOS(opts.OS).WithOSVersion(opts.OSVersion) + options.WithUsername(opts.Username).WithPassword(opts.Password).WithAuthfile(opts.Authfile) + if len(opts.Annotation) != 0 { + annotations := make(map[string]string) + for _, annotationSpec := range opts.Annotation { + spec := strings.SplitN(annotationSpec, "=", 2) + if len(spec) != 2 { + return "", fmt.Errorf("no value given for annotation %q", spec[0]) + } + annotations[spec[0]] = spec[1] + } + options.WithAnnotation(annotations) + } if s := opts.SkipTLSVerify; s != types.OptionalBoolUndefined { if s == types.OptionalBoolTrue { options.WithSkipTLSVerify(true) |