summaryrefslogtreecommitdiff
path: root/pkg/domain/entities
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-01-15 03:49:42 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-01-15 13:24:34 -0500
commitcf51c7ed9f955390a0e417f208046e0b8fbadb26 (patch)
treee20cf39ccab111aa9a86745fc9951f0a5f45ecf8 /pkg/domain/entities
parent5a166b297339d547d89fbf14248c3aff129eb960 (diff)
downloadpodman-cf51c7ed9f955390a0e417f208046e0b8fbadb26.tar.gz
podman-cf51c7ed9f955390a0e417f208046e0b8fbadb26.tar.bz2
podman-cf51c7ed9f955390a0e417f208046e0b8fbadb26.zip
Allow podman push to push manifest lists
When doing a podman images, manifests lists look just like images, so it is logical that users would assume that they can just podman push them to a registry. The problem is we throw out weird errors when this happens and users need to somehow figure out this is a manifest list rather then an image, and frankly the user will not understand the difference. This PR will make podman push just do the right thing, by failing over and attempting to push the manifest if it fails to push the image. Fix up handling of manifest push Protocol should bring back a digest string, which can either be printed or stored in a file. We should not reimplement the manifest push setup code in the tunnel code but take advantage of the api path, to make sure remote and local work the same way. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain/entities')
-rw-r--r--pkg/domain/entities/engine_image.go2
-rw-r--r--pkg/domain/entities/images.go4
-rw-r--r--pkg/domain/entities/manifest.go8
3 files changed, 5 insertions, 9 deletions
diff --git a/pkg/domain/entities/engine_image.go b/pkg/domain/entities/engine_image.go
index 26a136f13..935ee6f20 100644
--- a/pkg/domain/entities/engine_image.go
+++ b/pkg/domain/entities/engine_image.go
@@ -36,6 +36,6 @@ type ImageEngine interface {
ManifestAdd(ctx context.Context, opts ManifestAddOptions) (string, error)
ManifestAnnotate(ctx context.Context, names []string, opts ManifestAnnotateOptions) (string, error)
ManifestRemove(ctx context.Context, names []string) (string, error)
- ManifestPush(ctx context.Context, name, destination string, manifestPushOpts ManifestPushOptions) error
+ ManifestPush(ctx context.Context, name, destination string, imagePushOpts ImagePushOptions) (string, error)
Sign(ctx context.Context, names []string, options SignOptions) (*SignReport, error)
}
diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go
index 0805152c3..78a7d8aa7 100644
--- a/pkg/domain/entities/images.go
+++ b/pkg/domain/entities/images.go
@@ -165,6 +165,8 @@ type ImagePullReport struct {
// ImagePushOptions are the arguments for pushing images.
type ImagePushOptions struct {
+ // All indicates that all images referenced in an manifest list should be pushed
+ All bool
// Authfile is the path to the authentication file. Ignored for remote
// calls.
Authfile string
@@ -189,6 +191,8 @@ type ImagePushOptions struct {
// Quiet can be specified to suppress pull progress when pulling. Ignored
// for remote calls.
Quiet bool
+ // Rm indicates whether to remove the manifest list if push succeeds
+ Rm bool
// RemoveSignatures, discard any pre-existing signatures in the image.
// Ignored for remote calls.
RemoveSignatures bool
diff --git a/pkg/domain/entities/manifest.go b/pkg/domain/entities/manifest.go
index 01180951a..6a645e20b 100644
--- a/pkg/domain/entities/manifest.go
+++ b/pkg/domain/entities/manifest.go
@@ -33,11 +33,3 @@ type ManifestAnnotateOptions struct {
OSVersion string `json:"os_version" schema:"os_version"`
Variant string `json:"variant" schema:"variant"`
}
-
-type ManifestPushOptions struct {
- Purge, Quiet, All, RemoveSignatures bool
-
- Authfile, CertDir, Username, Password, DigestFile, Format, SignBy string
-
- SkipTLSVerify types.OptionalBool
-}