mirror of
https://github.com/containers/podman.git
synced 2025-06-29 06:57:13 +08:00
Remove the forceCompress parameter from getCopyOptions and DRO.GetSystemContext
Use the parent types.SystemContext data instead. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com> Closes: #1176 Approved by: rhatdan
This commit is contained in:

committed by
Atomic Bot

parent
b63b84ea5e
commit
7f5efd8d04
@ -24,17 +24,17 @@ type DockerRegistryOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetSystemContext constructs a new system context from a parent context. the values in the DockerRegistryOptions, and other parameters.
|
// GetSystemContext constructs a new system context from a parent context. the values in the DockerRegistryOptions, and other parameters.
|
||||||
func (o DockerRegistryOptions) GetSystemContext(parent *types.SystemContext, forceCompress bool, additionalDockerArchiveTags []reference.NamedTagged) *types.SystemContext {
|
func (o DockerRegistryOptions) GetSystemContext(parent *types.SystemContext, additionalDockerArchiveTags []reference.NamedTagged) *types.SystemContext {
|
||||||
sc := &types.SystemContext{
|
sc := &types.SystemContext{
|
||||||
DockerAuthConfig: o.DockerRegistryCreds,
|
DockerAuthConfig: o.DockerRegistryCreds,
|
||||||
DockerCertPath: o.DockerCertPath,
|
DockerCertPath: o.DockerCertPath,
|
||||||
DockerInsecureSkipTLSVerify: o.DockerInsecureSkipTLSVerify,
|
DockerInsecureSkipTLSVerify: o.DockerInsecureSkipTLSVerify,
|
||||||
DirForceCompress: forceCompress,
|
|
||||||
DockerArchiveAdditionalTags: additionalDockerArchiveTags,
|
DockerArchiveAdditionalTags: additionalDockerArchiveTags,
|
||||||
}
|
}
|
||||||
if parent != nil {
|
if parent != nil {
|
||||||
sc.SignaturePolicyPath = parent.SignaturePolicyPath
|
sc.SignaturePolicyPath = parent.SignaturePolicyPath
|
||||||
sc.AuthFilePath = parent.AuthFilePath
|
sc.AuthFilePath = parent.AuthFilePath
|
||||||
|
sc.DirForceCompress = parent.DirForceCompress
|
||||||
}
|
}
|
||||||
return sc
|
return sc
|
||||||
}
|
}
|
||||||
|
@ -551,7 +551,7 @@ func (i *Image) PushImageToReference(ctx context.Context, dest types.ImageRefere
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
copyOptions := getCopyOptions(sc, writer, nil, dockerRegistryOptions, signingOptions, manifestMIMEType, forceCompress, additionalDockerArchiveTags)
|
copyOptions := getCopyOptions(sc, writer, nil, dockerRegistryOptions, signingOptions, manifestMIMEType, additionalDockerArchiveTags)
|
||||||
if dest.Transport().Name() == DockerTransport {
|
if dest.Transport().Name() == DockerTransport {
|
||||||
imgRef := dest.DockerReference()
|
imgRef := dest.DockerReference()
|
||||||
if imgRef == nil { // This should never happen; such references can’t be created.
|
if imgRef == nil { // This should never happen; such references can’t be created.
|
||||||
@ -906,7 +906,7 @@ func (ir *Runtime) Import(ctx context.Context, path, reference string, writer io
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer policyContext.Destroy()
|
defer policyContext.Destroy()
|
||||||
copyOptions := getCopyOptions(sc, writer, nil, nil, signingOptions, "", false, nil)
|
copyOptions := getCopyOptions(sc, writer, nil, nil, signingOptions, "", nil)
|
||||||
dest, err := is.Transport.ParseStoreReference(ir.store, reference)
|
dest, err := is.Transport.ParseStoreReference(ir.store, reference)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errors.Wrapf(err, "error getting image reference for %q", reference)
|
errors.Wrapf(err, "error getting image reference for %q", reference)
|
||||||
|
@ -232,7 +232,7 @@ func (ir *Runtime) pullImage(ctx context.Context, inputName string, writer io.Wr
|
|||||||
}
|
}
|
||||||
var images []string
|
var images []string
|
||||||
for _, imageInfo := range goal.refPairs {
|
for _, imageInfo := range goal.refPairs {
|
||||||
copyOptions := getCopyOptions(sc, writer, dockerOptions, nil, signingOptions, "", false, nil)
|
copyOptions := getCopyOptions(sc, writer, dockerOptions, nil, signingOptions, "", nil)
|
||||||
if imageInfo.srcRef.Transport().Name() == DockerTransport {
|
if imageInfo.srcRef.Transport().Name() == DockerTransport {
|
||||||
imgRef := imageInfo.srcRef.DockerReference()
|
imgRef := imageInfo.srcRef.DockerReference()
|
||||||
if imgRef == nil { // This should never happen; such references can’t be created.
|
if imgRef == nil { // This should never happen; such references can’t be created.
|
||||||
|
@ -43,15 +43,15 @@ func findImageInRepotags(search imageParts, images []*Image) (*storage.Image, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
// getCopyOptions constructs a new containers/image/copy.Options{} struct from the given parameters, inheriting some from sc.
|
// getCopyOptions constructs a new containers/image/copy.Options{} struct from the given parameters, inheriting some from sc.
|
||||||
func getCopyOptions(sc *types.SystemContext, reportWriter io.Writer, srcDockerRegistry, destDockerRegistry *DockerRegistryOptions, signing SigningOptions, manifestType string, forceCompress bool, additionalDockerArchiveTags []reference.NamedTagged) *cp.Options {
|
func getCopyOptions(sc *types.SystemContext, reportWriter io.Writer, srcDockerRegistry, destDockerRegistry *DockerRegistryOptions, signing SigningOptions, manifestType string, additionalDockerArchiveTags []reference.NamedTagged) *cp.Options {
|
||||||
if srcDockerRegistry == nil {
|
if srcDockerRegistry == nil {
|
||||||
srcDockerRegistry = &DockerRegistryOptions{}
|
srcDockerRegistry = &DockerRegistryOptions{}
|
||||||
}
|
}
|
||||||
if destDockerRegistry == nil {
|
if destDockerRegistry == nil {
|
||||||
destDockerRegistry = &DockerRegistryOptions{}
|
destDockerRegistry = &DockerRegistryOptions{}
|
||||||
}
|
}
|
||||||
srcContext := srcDockerRegistry.GetSystemContext(sc, forceCompress, additionalDockerArchiveTags)
|
srcContext := srcDockerRegistry.GetSystemContext(sc, additionalDockerArchiveTags)
|
||||||
destContext := destDockerRegistry.GetSystemContext(sc, forceCompress, additionalDockerArchiveTags)
|
destContext := destDockerRegistry.GetSystemContext(sc, additionalDockerArchiveTags)
|
||||||
return &cp.Options{
|
return &cp.Options{
|
||||||
RemoveSignatures: signing.RemoveSignatures,
|
RemoveSignatures: signing.RemoveSignatures,
|
||||||
SignBy: signing.SignBy,
|
SignBy: signing.SignBy,
|
||||||
|
Reference in New Issue
Block a user