mirror of
https://github.com/containers/podman.git
synced 2025-11-01 22:32:50 +08:00
Vendor latest c/common and fix tests
This vendors the latest c/common version, including making Pasta the default rootless network provider. That broke a number of tests, which have been fixed as part of this PR. Also includes a change to network stats logic, which simplifies the code a bit and makes it actually work with Pasta. Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
26
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
26
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
@ -53,9 +53,16 @@ type PullOptions struct {
|
||||
// The error is storage.ErrImageUnknown iff the pull policy is set to "never"
|
||||
// and no local image has been found. This allows for an easier integration
|
||||
// into some users of this package (e.g., Buildah).
|
||||
func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullPolicy, options *PullOptions) ([]*Image, error) {
|
||||
func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullPolicy, options *PullOptions) (_ []*Image, pullError error) {
|
||||
logrus.Debugf("Pulling image %s (policy: %s)", name, pullPolicy)
|
||||
|
||||
if r.eventChannel != nil {
|
||||
defer func() {
|
||||
if pullError != nil {
|
||||
// Note that we use the input name here to preserve the transport data.
|
||||
r.writeEvent(&Event{Name: name, Time: time.Now(), Type: EventTypeImagePullError, Error: pullError})
|
||||
}
|
||||
}()
|
||||
}
|
||||
if options == nil {
|
||||
options = &PullOptions{}
|
||||
}
|
||||
@ -150,28 +157,25 @@ func (r *Runtime) Pull(ctx context.Context, name string, pullPolicy config.PullP
|
||||
options.Variant = r.systemContext.VariantChoice
|
||||
}
|
||||
|
||||
var (
|
||||
pulledImages []string
|
||||
pullError error
|
||||
)
|
||||
var pulledImages []string
|
||||
|
||||
// Dispatch the copy operation.
|
||||
switch ref.Transport().Name() {
|
||||
// DOCKER REGISTRY
|
||||
case registryTransport.Transport.Name():
|
||||
pulledImages, pullError = r.copyFromRegistry(ctx, ref, possiblyUnqualifiedName, pullPolicy, options)
|
||||
pulledImages, err = r.copyFromRegistry(ctx, ref, possiblyUnqualifiedName, pullPolicy, options)
|
||||
|
||||
// DOCKER ARCHIVE
|
||||
case dockerArchiveTransport.Transport.Name():
|
||||
pulledImages, pullError = r.copyFromDockerArchive(ctx, ref, &options.CopyOptions)
|
||||
pulledImages, err = r.copyFromDockerArchive(ctx, ref, &options.CopyOptions)
|
||||
|
||||
// ALL OTHER TRANSPORTS
|
||||
default:
|
||||
pulledImages, pullError = r.copyFromDefault(ctx, ref, &options.CopyOptions)
|
||||
pulledImages, err = r.copyFromDefault(ctx, ref, &options.CopyOptions)
|
||||
}
|
||||
|
||||
if pullError != nil {
|
||||
return nil, pullError
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localImages := []*Image{}
|
||||
|
||||
Reference in New Issue
Block a user