bump c/common to latest and c/storage to 1.37.0

Update c/common to fix a bug where broken config files could be created
via podman machine and podman system connection add.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2021-10-04 16:34:10 +02:00
parent 36821d302e
commit 8156df5b72
23 changed files with 566 additions and 308 deletions

View File

@ -2,7 +2,6 @@ package libimage
import (
"context"
"encoding/json"
"io"
"os"
"strings"

View File

@ -1,7 +1,6 @@
package libimage
import (
"encoding/json"
"fmt"
"path/filepath"
"strconv"

View File

@ -2,7 +2,6 @@ package libimage
import (
"context"
"encoding/json"
"time"
"github.com/containers/image/v5/manifest"

View File

@ -35,6 +35,17 @@ func (r *Runtime) Load(ctx context.Context, path string, options *LoadOptions) (
var loadErrors []error
for _, f := range []func() ([]string, string, error){
// DOCKER-ARCHIVE - must be first (see containers/podman/issues/10809)
func() ([]string, string, error) {
logrus.Debugf("-> Attempting to load %q as a Docker archive", path)
ref, err := dockerArchiveTransport.ParseReference(path)
if err != nil {
return nil, dockerArchiveTransport.Transport.Name(), err
}
images, err := r.loadMultiImageDockerArchive(ctx, ref, &options.CopyOptions)
return images, dockerArchiveTransport.Transport.Name(), err
},
// OCI
func() ([]string, string, error) {
logrus.Debugf("-> Attempting to load %q as an OCI directory", path)
@ -67,17 +78,6 @@ func (r *Runtime) Load(ctx context.Context, path string, options *LoadOptions) (
images, err := r.copyFromDefault(ctx, ref, &options.CopyOptions)
return images, dirTransport.Transport.Name(), err
},
// DOCKER-ARCHIVE
func() ([]string, string, error) {
logrus.Debugf("-> Attempting to load %q as a Docker archive", path)
ref, err := dockerArchiveTransport.ParseReference(path)
if err != nil {
return nil, dockerArchiveTransport.Transport.Name(), err
}
images, err := r.loadMultiImageDockerArchive(ctx, ref, &options.CopyOptions)
return images, dockerArchiveTransport.Transport.Name(), err
},
} {
loadedImages, transportName, err := f()
if err == nil {

View File

@ -13,10 +13,14 @@ import (
"github.com/containers/image/v5/types"
"github.com/containers/storage"
deepcopy "github.com/jinzhu/copier"
jsoniter "github.com/json-iterator/go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
// Faster than the standard library, see https://github.com/json-iterator/go.
var json = jsoniter.ConfigCompatibleWithStandardLibrary
// RuntimeOptions allow for creating a customized Runtime.
type RuntimeOptions struct {
// The base system context of the runtime which will be used throughout