summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2018-12-03 22:41:10 +0100
committerMiloslav Trmač <mitr@redhat.com>2018-12-06 23:34:59 +0100
commit1b893be71c82edf3b1ed3239026cc7f6df3e3560 (patch)
tree9f448810ecde21246c114c99fc668e024a5d702a /libpod/image/image.go
parent8150c942d5cfd062c9ad46d27ef2b9cd87763773 (diff)
downloadpodman-1b893be71c82edf3b1ed3239026cc7f6df3e3560.tar.gz
podman-1b893be71c82edf3b1ed3239026cc7f6df3e3560.tar.bz2
podman-1b893be71c82edf3b1ed3239026cc7f6df3e3560.zip
Remove manual handling of insecure registries in PushImageToReference
Instead, just set SystemRegistriesConfPath and let the transport do it. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index a6b2e4288..c741ae004 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -534,23 +534,8 @@ func (i *Image) PushImageToReference(ctx context.Context, dest types.ImageRefere
if err != nil {
return errors.Wrapf(err, "error getting source imageReference for %q", i.InputName)
}
- insecureRegistries, err := registries.GetInsecureRegistries()
- if err != nil {
- return err
- }
copyOptions := getCopyOptions(sc, writer, nil, dockerRegistryOptions, signingOptions, manifestMIMEType, additionalDockerArchiveTags)
- if dest.Transport().Name() == DockerTransport {
- imgRef := dest.DockerReference()
- if imgRef == nil { // This should never happen; such references can’t be created.
- return fmt.Errorf("internal error: DockerTransport reference %s does not have a DockerReference", transports.ImageName(dest))
- }
- registry := reference.Domain(imgRef)
-
- if util.StringInSlice(registry, insecureRegistries) && dockerRegistryOptions.DockerInsecureSkipTLSVerify != types.OptionalBoolFalse {
- copyOptions.DestinationCtx.DockerInsecureSkipTLSVerify = types.OptionalBoolTrue
- logrus.Info(fmt.Sprintf("%s is an insecure registry; pushing with tls-verify=false", registry))
- }
- }
+ copyOptions.DestinationCtx.SystemRegistriesConfPath = registries.SystemRegistriesConfPath() // FIXME: Set this more globally. Probably no reason not to have it in every types.SystemContext, and to compute the value just once in one place.
// Copy the image to the remote destination
_, err = cp.Image(ctx, policyContext, dest, src, copyOptions)
if err != nil {