summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-28 16:02:56 -0400
committerGitHub <noreply@github.com>2020-08-28 16:02:56 -0400
commit97780a110b58a3bcc983bff75f3665768271631c (patch)
treeba803042c50a294dd6bc1d6f3d75f1a2be5619a5 /pkg
parentc069e0bad9f4aa8da98c46d702f450ce41da6346 (diff)
parent3c6603a2f88ab5ba38bf58334417aaa90c458c06 (diff)
downloadpodman-97780a110b58a3bcc983bff75f3665768271631c.tar.gz
podman-97780a110b58a3bcc983bff75f3665768271631c.tar.bz2
podman-97780a110b58a3bcc983bff75f3665768271631c.zip
Merge pull request #7436 from rhatdan/variant
Add support for image pull overrides
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/libpod/images.go12
-rw-r--r--pkg/api/server/register_images.go8
-rw-r--r--pkg/bindings/images/images.go1
-rw-r--r--pkg/domain/entities/images.go2
-rw-r--r--pkg/domain/infra/abi/images.go1
5 files changed, 17 insertions, 7 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index 51013acf1..8d3fc4e00 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -338,11 +338,12 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
decoder := r.Context().Value("decoder").(*schema.Decoder)
query := struct {
- Reference string `schema:"reference"`
- OverrideOS string `schema:"overrideOS"`
- OverrideArch string `schema:"overrideArch"`
- TLSVerify bool `schema:"tlsVerify"`
- AllTags bool `schema:"allTags"`
+ Reference string `schema:"reference"`
+ OverrideOS string `schema:"overrideOS"`
+ OverrideArch string `schema:"overrideArch"`
+ OverrideVariant string `schema:"overrideVariant"`
+ TLSVerify bool `schema:"tlsVerify"`
+ AllTags bool `schema:"allTags"`
}{
TLSVerify: true,
}
@@ -393,6 +394,7 @@ func ImagesPull(w http.ResponseWriter, r *http.Request) {
DockerRegistryCreds: authConf,
OSChoice: query.OverrideOS,
ArchitectureChoice: query.OverrideArch,
+ VariantChoice: query.OverrideVariant,
}
if _, found := r.URL.Query()["tlsVerify"]; found {
dockerRegistryOptions.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!query.TLSVerify)
diff --git a/pkg/api/server/register_images.go b/pkg/api/server/register_images.go
index 748e3fb11..64258a073 100644
--- a/pkg/api/server/register_images.go
+++ b/pkg/api/server/register_images.go
@@ -905,12 +905,16 @@ func (s *APIServer) registerImagesHandlers(r *mux.Router) error {
// description: "username:password for the registry"
// type: string
// - in: query
+ // name: overrideArch
+ // description: Pull image for the specified architecture.
+ // type: string
+ // - in: query
// name: overrideOS
// description: Pull image for the specified operating system.
// type: string
// - in: query
- // name: overrideArch
- // description: Pull image for the specified architecture.
+ // name: overrideVariant
+ // description: Pull image for the specified variant.
// type: string
// - in: query
// name: tlsVerify
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index 12d1a9ce9..9f6e78b79 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -365,6 +365,7 @@ func Pull(ctx context.Context, rawImage string, options entities.ImagePullOption
params.Set("reference", rawImage)
params.Set("overrideArch", options.OverrideArch)
params.Set("overrideOS", options.OverrideOS)
+ params.Set("overrideVariant", options.OverrideVariant)
if options.SkipTLSVerify != types.OptionalBoolUndefined {
// Note: we have to verify if skipped is false.
verifyTLS := bool(options.SkipTLSVerify == types.OptionalBoolFalse)
diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go
index cb970b09a..3a12a4e22 100644
--- a/pkg/domain/entities/images.go
+++ b/pkg/domain/entities/images.go
@@ -137,6 +137,8 @@ type ImagePullOptions struct {
// OverrideOS will overwrite the local operating system (OS) for image
// pulls.
OverrideOS string
+ // OverrideVariant will overwrite the local variant for image pulls.
+ OverrideVariant string
// Quiet can be specified to suppress pull progress when pulling. Ignored
// for remote calls.
Quiet bool
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 70d740bb5..6b94ca9c0 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -251,6 +251,7 @@ func (ir *ImageEngine) Pull(ctx context.Context, rawImage string, options entiti
DockerCertPath: options.CertDir,
OSChoice: options.OverrideOS,
ArchitectureChoice: options.OverrideArch,
+ VariantChoice: options.OverrideVariant,
DockerInsecureSkipTLSVerify: options.SkipTLSVerify,
}