mirror of
https://github.com/containers/podman.git
synced 2025-06-22 01:48:54 +08:00
Merge pull request #19472 from flouthoc/bump-common-image
vendor: bump `c/image` -> `8c387a14f4ac` and `c/common` -> `44bfd82e3ed2`
This commit is contained in:
8
go.mod
8
go.mod
@ -13,9 +13,9 @@ require (
|
||||
github.com/containernetworking/cni v1.1.2
|
||||
github.com/containernetworking/plugins v1.3.0
|
||||
github.com/containers/buildah v1.31.1-0.20230722114901-5ece066f82c6
|
||||
github.com/containers/common v0.55.1-0.20230726131109-ff8298511408
|
||||
github.com/containers/common v0.55.1-0.20230801150045-44bfd82e3ed2
|
||||
github.com/containers/conmon v2.0.20+incompatible
|
||||
github.com/containers/image/v5 v5.26.1-0.20230721194716-30c87d4a5b8d
|
||||
github.com/containers/image/v5 v5.26.1-0.20230726142307-8c387a14f4ac
|
||||
github.com/containers/libhvee v0.4.0
|
||||
github.com/containers/ocicrypt v1.1.7
|
||||
github.com/containers/psgo v1.8.0
|
||||
@ -85,7 +85,7 @@ require (
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
|
||||
github.com/chzyer/readline v1.5.1 // indirect
|
||||
github.com/containerd/cgroups v1.1.0 // indirect
|
||||
github.com/containerd/containerd v1.7.2 // indirect
|
||||
github.com/containerd/containerd v1.7.3 // indirect
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
|
||||
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
|
||||
github.com/coreos/go-oidc/v3 v3.6.0 // indirect
|
||||
@ -174,7 +174,7 @@ require (
|
||||
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||
github.com/vbatts/tar-split v0.11.3 // indirect
|
||||
github.com/vbatts/tar-split v0.11.5 // indirect
|
||||
github.com/vishvananda/netns v0.0.4 // indirect
|
||||
go.mongodb.org/mongo-driver v1.11.3 // indirect
|
||||
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
|
||||
|
19
go.sum
19
go.sum
@ -43,7 +43,6 @@ github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ
|
||||
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.2.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
|
||||
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
@ -188,8 +187,8 @@ github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09Zvgq
|
||||
github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s=
|
||||
github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g=
|
||||
github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c=
|
||||
github.com/containerd/containerd v1.7.2 h1:UF2gdONnxO8I6byZXDi5sXWiWvlW3D/sci7dTQimEJo=
|
||||
github.com/containerd/containerd v1.7.2/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
|
||||
github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o=
|
||||
github.com/containerd/containerd v1.7.3/go.mod h1:32FOM4/O0RkNg7AjQj3hDzN9cUGtu+HMvaKUNiqCZB8=
|
||||
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||
github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||
@ -247,12 +246,12 @@ github.com/containernetworking/plugins v1.3.0 h1:QVNXMT6XloyMUoO2wUOqWTC1hWFV62Q
|
||||
github.com/containernetworking/plugins v1.3.0/go.mod h1:Pc2wcedTQQCVuROOOaLBPPxrEXqqXBFt3cZ+/yVg6l0=
|
||||
github.com/containers/buildah v1.31.1-0.20230722114901-5ece066f82c6 h1:K/S8SFQsnnNTF0Ws58SrBD9L0EuClzAG8Zp08d7+6AA=
|
||||
github.com/containers/buildah v1.31.1-0.20230722114901-5ece066f82c6/go.mod h1:0sptTFBBtSznLqoTh80DfvMOCNbdRsNRgVOKhBhrupA=
|
||||
github.com/containers/common v0.55.1-0.20230726131109-ff8298511408 h1:l1CWncvHE9fXr1oTCbecNCM29pxozduFw3wyALlPpkQ=
|
||||
github.com/containers/common v0.55.1-0.20230726131109-ff8298511408/go.mod h1:1JS5V5cf9DhEvSGMRfpD4YmTGeyhJ//YUee8qS+8fOw=
|
||||
github.com/containers/common v0.55.1-0.20230801150045-44bfd82e3ed2 h1:E6OuqpGlvUVoTXelRD0NtYTBQTZQeoWh1pMAVjmbIks=
|
||||
github.com/containers/common v0.55.1-0.20230801150045-44bfd82e3ed2/go.mod h1:VlEW0hd11FqVMbWYYjuDCU1+IEqElPZO1RznrRHkxyQ=
|
||||
github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg=
|
||||
github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
|
||||
github.com/containers/image/v5 v5.26.1-0.20230721194716-30c87d4a5b8d h1:g6DFcXXEMd1OwSVtbrUolGzmkMNyQDyc4OKHOFxbNeE=
|
||||
github.com/containers/image/v5 v5.26.1-0.20230721194716-30c87d4a5b8d/go.mod h1:dq4a9AttQovSzgEgbRoz+BRcfRFLaz16zrMAlf5DoCY=
|
||||
github.com/containers/image/v5 v5.26.1-0.20230726142307-8c387a14f4ac h1:EQQX+EO+F30H9vJS6vfDXx83Z6OL1YNkO5LN36BtPnM=
|
||||
github.com/containers/image/v5 v5.26.1-0.20230726142307-8c387a14f4ac/go.mod h1:Zg7m6YHPZRl/wbUDZ6vt+yAyXAjAvALVUelmsIPpMcE=
|
||||
github.com/containers/libhvee v0.4.0 h1:HGHIIExgP2PjwjHKKoQM3B+3qakNIZcmmkiAO4luAZE=
|
||||
github.com/containers/libhvee v0.4.0/go.mod h1:fyWDxNQccveTdE3Oe+QRuLbwF/iyV0hDxXqRX5Svlic=
|
||||
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA=
|
||||
@ -1007,10 +1006,9 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX
|
||||
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8=
|
||||
github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI=
|
||||
github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck=
|
||||
github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY=
|
||||
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
|
||||
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
|
||||
github.com/vbauerster/mpb/v8 v8.5.2 h1:zanzt1cZpSEG5uGNYKcv43+97f0IgEnXpuBFaMxKbM0=
|
||||
github.com/vbauerster/mpb/v8 v8.5.2/go.mod h1:YqKyR4ZR6Gd34yD3cDHPMmQxc+uUQMwjgO/LkxiJQ6I=
|
||||
github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk=
|
||||
@ -1293,7 +1291,6 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
|
||||
|
48
vendor/github.com/containerd/containerd/log/context.go
generated
vendored
48
vendor/github.com/containerd/containerd/log/context.go
generated
vendored
@ -18,6 +18,7 @@ package log
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -38,6 +39,9 @@ type (
|
||||
|
||||
// Fields type to pass to `WithFields`, alias from `logrus`.
|
||||
Fields = logrus.Fields
|
||||
|
||||
// Level is a logging level
|
||||
Level = logrus.Level
|
||||
)
|
||||
|
||||
const (
|
||||
@ -50,8 +54,52 @@ const (
|
||||
|
||||
// JSONFormat represents the JSON logging format
|
||||
JSONFormat = "json"
|
||||
|
||||
// TraceLevel level.
|
||||
TraceLevel = logrus.TraceLevel
|
||||
|
||||
// DebugLevel level.
|
||||
DebugLevel = logrus.DebugLevel
|
||||
|
||||
// InfoLevel level.
|
||||
InfoLevel = logrus.InfoLevel
|
||||
)
|
||||
|
||||
// SetLevel sets log level globally.
|
||||
func SetLevel(level string) error {
|
||||
lvl, err := logrus.ParseLevel(level)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
logrus.SetLevel(lvl)
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetLevel returns the current log level.
|
||||
func GetLevel() Level {
|
||||
return logrus.GetLevel()
|
||||
}
|
||||
|
||||
// SetFormat sets log output format
|
||||
func SetFormat(format string) error {
|
||||
switch format {
|
||||
case TextFormat:
|
||||
logrus.SetFormatter(&logrus.TextFormatter{
|
||||
TimestampFormat: RFC3339NanoFixed,
|
||||
FullTimestamp: true,
|
||||
})
|
||||
case JSONFormat:
|
||||
logrus.SetFormatter(&logrus.JSONFormatter{
|
||||
TimestampFormat: RFC3339NanoFixed,
|
||||
})
|
||||
default:
|
||||
return fmt.Errorf("unknown log format: %s", format)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithLogger returns a new context with the provided logger. Use in
|
||||
// combination with logger.WithField(s) for great effect.
|
||||
func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context {
|
||||
|
3
vendor/github.com/containers/common/libimage/manifest_list.go
generated
vendored
3
vendor/github.com/containers/common/libimage/manifest_list.go
generated
vendored
@ -415,6 +415,8 @@ type ManifestListPushOptions struct {
|
||||
ImageListSelection imageCopy.ImageListSelection
|
||||
// Use when selecting only specific imags.
|
||||
Instances []digest.Digest
|
||||
// Add existing instances with requested compression algorithms to manifest list
|
||||
AddCompression []string
|
||||
}
|
||||
|
||||
// Push pushes a manifest to the specified destination.
|
||||
@ -446,6 +448,7 @@ func (m *ManifestList) Push(ctx context.Context, destination string, options *Ma
|
||||
defer copier.close()
|
||||
|
||||
pushOptions := manifests.PushOptions{
|
||||
AddCompression: options.AddCompression,
|
||||
Store: m.image.runtime.store,
|
||||
SystemContext: copier.systemContext,
|
||||
ImageListSelection: options.ImageListSelection,
|
||||
|
19
vendor/github.com/containers/common/libimage/manifests/manifests.go
generated
vendored
19
vendor/github.com/containers/common/libimage/manifests/manifests.go
generated
vendored
@ -14,6 +14,7 @@ import (
|
||||
"github.com/containers/image/v5/docker/reference"
|
||||
"github.com/containers/image/v5/image"
|
||||
"github.com/containers/image/v5/manifest"
|
||||
"github.com/containers/image/v5/pkg/compression"
|
||||
"github.com/containers/image/v5/signature"
|
||||
"github.com/containers/image/v5/signature/signer"
|
||||
is "github.com/containers/image/v5/storage"
|
||||
@ -70,6 +71,7 @@ type PushOptions struct {
|
||||
RemoveSignatures bool // true to discard signatures in images
|
||||
ManifestType string // the format to use when saving the list - possible options are oci, v2s1, and v2s2
|
||||
SourceFilter LookupReferenceFunc // filter the list source
|
||||
AddCompression []string // add existing instances with requested compression algorithms to manifest list
|
||||
}
|
||||
|
||||
// Create creates a new list containing information about the specified image,
|
||||
@ -239,6 +241,10 @@ func (l *list) Push(ctx context.Context, dest types.ImageReference, options Push
|
||||
return nil, "", err
|
||||
}
|
||||
}
|
||||
compressionVariants, err := prepareAddWithCompression(options.AddCompression)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
copyOptions := &cp.Options{
|
||||
ImageListSelection: options.ImageListSelection,
|
||||
Instances: options.Instances,
|
||||
@ -252,6 +258,7 @@ func (l *list) Push(ctx context.Context, dest types.ImageReference, options Push
|
||||
SignBySigstorePrivateKeyFile: options.SignBySigstorePrivateKeyFile,
|
||||
SignSigstorePrivateKeyPassphrase: options.SignSigstorePrivateKeyPassphrase,
|
||||
ForceManifestMIMEType: singleImageManifestType,
|
||||
EnsureCompressionVariantsExist: compressionVariants,
|
||||
}
|
||||
|
||||
// Copy whatever we were asked to copy.
|
||||
@ -266,6 +273,18 @@ func (l *list) Push(ctx context.Context, dest types.ImageReference, options Push
|
||||
return nil, manifestDigest, nil
|
||||
}
|
||||
|
||||
func prepareAddWithCompression(variants []string) ([]cp.OptionCompressionVariant, error) {
|
||||
res := []cp.OptionCompressionVariant{}
|
||||
for _, name := range variants {
|
||||
algo, err := compression.AlgorithmByName(name)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("requested algorithm %s is not supported for replication: %w", name, err)
|
||||
}
|
||||
res = append(res, cp.OptionCompressionVariant{Algorithm: algo})
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// Add adds information about the specified image to the list, computing the
|
||||
// image's manifest's digest, retrieving OS and architecture information from
|
||||
// the image's configuration, and recording the image's reference so that it
|
||||
|
35
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
35
vendor/github.com/containers/common/pkg/config/config.go
generated
vendored
@ -1168,27 +1168,6 @@ func IsValidDeviceMode(mode string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// resolveHomeDir converts a path referencing the home directory via "~"
|
||||
// to an absolute path
|
||||
func resolveHomeDir(path string) (string, error) {
|
||||
// check if the path references the home dir to avoid work
|
||||
// don't use strings.HasPrefix(path, "~") as this doesn't match "~" alone
|
||||
// use strings.HasPrefix(...) to not match "something/~/something"
|
||||
if !(path == "~" || strings.HasPrefix(path, "~/")) {
|
||||
// path does not reference home dir -> Nothing to do
|
||||
return path, nil
|
||||
}
|
||||
|
||||
// only get HomeDir when necessary
|
||||
home, err := unshare.HomeDir()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// replace the first "~" (start of path) with the HomeDir to resolve "~"
|
||||
return strings.Replace(path, "~", home, 1), nil
|
||||
}
|
||||
|
||||
func rootlessConfigPath() (string, error) {
|
||||
if configHome := os.Getenv("XDG_CONFIG_HOME"); configHome != "" {
|
||||
return filepath.Join(configHome, _configPath), nil
|
||||
@ -1201,20 +1180,6 @@ func rootlessConfigPath() (string, error) {
|
||||
return filepath.Join(home, UserOverrideContainersConfig), nil
|
||||
}
|
||||
|
||||
func stringsEq(a, b []string) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
}
|
||||
|
||||
for i := range a {
|
||||
if a[i] != b[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var (
|
||||
configErr error
|
||||
configMutex sync.Mutex
|
||||
|
26
vendor/github.com/containers/common/pkg/config/config_local.go
generated
vendored
26
vendor/github.com/containers/common/pkg/config/config_local.go
generated
vendored
@ -9,37 +9,11 @@ import (
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/container-orchestrated-devices/container-device-interface/pkg/parser"
|
||||
units "github.com/docker/go-units"
|
||||
)
|
||||
|
||||
// isDirectory tests whether the given path exists and is a directory. It
|
||||
// follows symlinks.
|
||||
func isDirectory(path string) error {
|
||||
path, err := resolveHomeDir(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !info.Mode().IsDir() {
|
||||
// Return a PathError to be consistent with os.Stat().
|
||||
return &os.PathError{
|
||||
Op: "stat",
|
||||
Path: path,
|
||||
Err: syscall.ENOTDIR,
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *EngineConfig) validatePaths() error {
|
||||
// Relative paths can cause nasty bugs, because core paths we use could
|
||||
// shift between runs or even parts of the program. - The OCI runtime
|
||||
|
1
vendor/github.com/containers/common/pkg/config/containers.conf
generated
vendored
1
vendor/github.com/containers/common/pkg/config/containers.conf
generated
vendored
@ -119,7 +119,6 @@ default_sysctls = [
|
||||
#
|
||||
#env = [
|
||||
# "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||
# "TERM=xterm",
|
||||
#]
|
||||
|
||||
# Pass all host environment variables into the container.
|
||||
|
1
vendor/github.com/containers/common/pkg/config/containers.conf-freebsd
generated
vendored
1
vendor/github.com/containers/common/pkg/config/containers.conf-freebsd
generated
vendored
@ -99,7 +99,6 @@ default_sysctls = [
|
||||
#
|
||||
#env = [
|
||||
# "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||
# "TERM=xterm",
|
||||
#]
|
||||
|
||||
# Pass all host environment variables into the container.
|
||||
|
1
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
1
vendor/github.com/containers/common/pkg/config/default.go
generated
vendored
@ -202,7 +202,6 @@ func DefaultConfig() (*Config, error) {
|
||||
EnableLabeling: selinuxEnabled(),
|
||||
Env: []string{
|
||||
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
||||
"TERM=xterm",
|
||||
},
|
||||
EnvHost: false,
|
||||
HTTPProxy: true,
|
||||
|
22
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
22
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
@ -17,6 +17,7 @@ import (
|
||||
"github.com/containers/image/v5/internal/private"
|
||||
"github.com/containers/image/v5/manifest"
|
||||
"github.com/containers/image/v5/pkg/blobinfocache"
|
||||
compression "github.com/containers/image/v5/pkg/compression/types"
|
||||
"github.com/containers/image/v5/signature"
|
||||
"github.com/containers/image/v5/signature/signer"
|
||||
"github.com/containers/image/v5/transports"
|
||||
@ -126,6 +127,21 @@ type Options struct {
|
||||
// Download layer contents with "nondistributable" media types ("foreign" layers) and translate the layer media type
|
||||
// to not indicate "nondistributable".
|
||||
DownloadForeignLayers bool
|
||||
|
||||
// Contains slice of OptionCompressionVariant, where copy will ensure that for each platform
|
||||
// in the manifest list, a variant with the requested compression will exist.
|
||||
// Invalid when copying a non-multi-architecture image. That will probably
|
||||
// change in the future.
|
||||
EnsureCompressionVariantsExist []OptionCompressionVariant
|
||||
}
|
||||
|
||||
// OptionCompressionVariant allows to supply information about
|
||||
// selected compression algorithm and compression level by the
|
||||
// end-user. Refer to EnsureCompressionVariantsExist to know
|
||||
// more about its usage.
|
||||
type OptionCompressionVariant struct {
|
||||
Algorithm compression.Algorithm
|
||||
Level *int // Only used when we are creating a new image instance using the specified algorithm, not when the image already contains such an instance
|
||||
}
|
||||
|
||||
// copier allows us to keep track of diffID values for blobs, and other
|
||||
@ -250,6 +266,9 @@ func Image(ctx context.Context, policyContext *signature.PolicyContext, destRef,
|
||||
}
|
||||
|
||||
if !multiImage {
|
||||
if len(options.EnsureCompressionVariantsExist) > 0 {
|
||||
return nil, fmt.Errorf("EnsureCompressionVariantsExist is not implemented when not creating a multi-architecture image")
|
||||
}
|
||||
// The simple case: just copy a single image.
|
||||
single, err := c.copySingleImage(ctx, c.unparsedToplevel, nil, copySingleImageOptions{requireCompressionFormatMatch: false})
|
||||
if err != nil {
|
||||
@ -257,6 +276,9 @@ func Image(ctx context.Context, policyContext *signature.PolicyContext, destRef,
|
||||
}
|
||||
copiedManifest = single.manifest
|
||||
} else if c.options.ImageListSelection == CopySystemImage {
|
||||
if len(options.EnsureCompressionVariantsExist) > 0 {
|
||||
return nil, fmt.Errorf("EnsureCompressionVariantsExist is not implemented when not creating a multi-architecture image")
|
||||
}
|
||||
// This is a manifest list, and we weren't asked to copy multiple images. Choose a single image that
|
||||
// matches the current system to copy, and copy it.
|
||||
mfest, manifestType, err := c.unparsedToplevel.Manifest(ctx)
|
||||
|
131
vendor/github.com/containers/image/v5/copy/multiple.go
generated
vendored
131
vendor/github.com/containers/image/v5/copy/multiple.go
generated
vendored
@ -5,15 +5,19 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/image/v5/docker/reference"
|
||||
"github.com/containers/image/v5/internal/image"
|
||||
internalManifest "github.com/containers/image/v5/internal/manifest"
|
||||
"github.com/containers/image/v5/internal/set"
|
||||
"github.com/containers/image/v5/manifest"
|
||||
"github.com/containers/image/v5/pkg/compression"
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
@ -27,23 +31,118 @@ const (
|
||||
type instanceCopy struct {
|
||||
op instanceCopyKind
|
||||
sourceDigest digest.Digest
|
||||
|
||||
// Fields which can be used by callers when operation
|
||||
// is `instanceCopyClone`
|
||||
cloneCompressionVariant OptionCompressionVariant
|
||||
clonePlatform *imgspecv1.Platform
|
||||
cloneAnnotations map[string]string
|
||||
}
|
||||
|
||||
// internal type only to make imgspecv1.Platform comparable
|
||||
type platformComparable struct {
|
||||
architecture string
|
||||
os string
|
||||
osVersion string
|
||||
osFeatures string
|
||||
variant string
|
||||
}
|
||||
|
||||
// Converts imgspecv1.Platform to a comparable format.
|
||||
func platformV1ToPlatformComparable(platform *imgspecv1.Platform) platformComparable {
|
||||
if platform == nil {
|
||||
return platformComparable{}
|
||||
}
|
||||
osFeatures := slices.Clone(platform.OSFeatures)
|
||||
sort.Strings(osFeatures)
|
||||
return platformComparable{architecture: platform.Architecture,
|
||||
os: platform.OS,
|
||||
// This is strictly speaking ambiguous, fields of OSFeatures can contain a ','. Probably good enough for now.
|
||||
osFeatures: strings.Join(osFeatures, ","),
|
||||
osVersion: platform.OSVersion,
|
||||
variant: platform.Variant,
|
||||
}
|
||||
}
|
||||
|
||||
// platformCompressionMap prepares a mapping of platformComparable -> CompressionAlgorithmNames for given digests
|
||||
func platformCompressionMap(list internalManifest.List, instanceDigests []digest.Digest) (map[platformComparable]*set.Set[string], error) {
|
||||
res := make(map[platformComparable]*set.Set[string])
|
||||
for _, instanceDigest := range instanceDigests {
|
||||
instanceDetails, err := list.Instance(instanceDigest)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("getting details for instance %s: %w", instanceDigest, err)
|
||||
}
|
||||
platform := platformV1ToPlatformComparable(instanceDetails.ReadOnly.Platform)
|
||||
platformSet, ok := res[platform]
|
||||
if !ok {
|
||||
platformSet = set.New[string]()
|
||||
res[platform] = platformSet
|
||||
}
|
||||
platformSet.AddSlice(instanceDetails.ReadOnly.CompressionAlgorithmNames)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func validateCompressionVariantExists(input []OptionCompressionVariant) error {
|
||||
for _, option := range input {
|
||||
_, err := compression.AlgorithmByName(option.Algorithm.Name())
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid algorithm %q in option.EnsureCompressionVariantsExist: %w", option.Algorithm.Name(), err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// prepareInstanceCopies prepares a list of instances which needs to copied to the manifest list.
|
||||
func prepareInstanceCopies(instanceDigests []digest.Digest, options *Options) []instanceCopy {
|
||||
func prepareInstanceCopies(list internalManifest.List, instanceDigests []digest.Digest, options *Options) ([]instanceCopy, error) {
|
||||
res := []instanceCopy{}
|
||||
if options.ImageListSelection == CopySpecificImages && len(options.EnsureCompressionVariantsExist) > 0 {
|
||||
// List can already contain compressed instance for a compression selected in `EnsureCompressionVariantsExist`
|
||||
// It’s unclear what it means when `CopySpecificImages` includes an instance in options.Instances,
|
||||
// EnsureCompressionVariantsExist asks for an instance with some compression,
|
||||
// an instance with that compression already exists, but is not included in options.Instances.
|
||||
// We might define the semantics and implement this in the future.
|
||||
return res, fmt.Errorf("EnsureCompressionVariantsExist is not implemented for CopySpecificImages")
|
||||
}
|
||||
err := validateCompressionVariantExists(options.EnsureCompressionVariantsExist)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
compressionsByPlatform, err := platformCompressionMap(list, instanceDigests)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for i, instanceDigest := range instanceDigests {
|
||||
if options.ImageListSelection == CopySpecificImages &&
|
||||
!slices.Contains(options.Instances, instanceDigest) {
|
||||
logrus.Debugf("Skipping instance %s (%d/%d)", instanceDigest, i+1, len(instanceDigests))
|
||||
continue
|
||||
}
|
||||
instanceDetails, err := list.Instance(instanceDigest)
|
||||
if err != nil {
|
||||
return res, fmt.Errorf("getting details for instance %s: %w", instanceDigest, err)
|
||||
}
|
||||
platform := platformV1ToPlatformComparable(instanceDetails.ReadOnly.Platform)
|
||||
compressionList := compressionsByPlatform[platform]
|
||||
for _, compressionVariant := range options.EnsureCompressionVariantsExist {
|
||||
if !compressionList.Contains(compressionVariant.Algorithm.Name()) {
|
||||
res = append(res, instanceCopy{
|
||||
op: instanceCopyClone,
|
||||
sourceDigest: instanceDigest,
|
||||
cloneCompressionVariant: compressionVariant,
|
||||
clonePlatform: instanceDetails.ReadOnly.Platform,
|
||||
cloneAnnotations: maps.Clone(instanceDetails.ReadOnly.Annotations),
|
||||
})
|
||||
// add current compression to the list so that we don’t create duplicate clones
|
||||
compressionList.Add(compressionVariant.Algorithm.Name())
|
||||
}
|
||||
}
|
||||
res = append(res, instanceCopy{
|
||||
op: instanceCopyCopy,
|
||||
sourceDigest: instanceDigest,
|
||||
})
|
||||
}
|
||||
return res
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// copyMultipleImages copies some or all of an image list's instances, using
|
||||
@ -118,8 +217,11 @@ func (c *copier) copyMultipleImages(ctx context.Context) (copiedManifest []byte,
|
||||
// Copy each image, or just the ones we want to copy, in turn.
|
||||
instanceDigests := updatedList.Instances()
|
||||
instanceEdits := []internalManifest.ListEdit{}
|
||||
instanceCopyList := prepareInstanceCopies(instanceDigests, c.options)
|
||||
c.Printf("Copying %d of %d images in list\n", len(instanceCopyList), len(instanceDigests))
|
||||
instanceCopyList, err := prepareInstanceCopies(updatedList, instanceDigests, c.options)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("preparing instances for copy: %w", err)
|
||||
}
|
||||
c.Printf("Copying %d images generated from %d images in list\n", len(instanceCopyList), len(instanceDigests))
|
||||
for i, instance := range instanceCopyList {
|
||||
// Update instances to be edited by their `ListOperation` and
|
||||
// populate necessary fields.
|
||||
@ -140,6 +242,27 @@ func (c *copier) copyMultipleImages(ctx context.Context) (copiedManifest []byte,
|
||||
UpdateSize: int64(len(updated.manifest)),
|
||||
UpdateCompressionAlgorithms: updated.compressionAlgorithms,
|
||||
UpdateMediaType: updated.manifestMIMEType})
|
||||
case instanceCopyClone:
|
||||
logrus.Debugf("Replicating instance %s (%d/%d)", instance.sourceDigest, i+1, len(instanceCopyList))
|
||||
c.Printf("Replicating image %s (%d/%d)\n", instance.sourceDigest, i+1, len(instanceCopyList))
|
||||
unparsedInstance := image.UnparsedInstance(c.rawSource, &instanceCopyList[i].sourceDigest)
|
||||
updated, err := c.copySingleImage(ctx, unparsedInstance, &instanceCopyList[i].sourceDigest, copySingleImageOptions{
|
||||
requireCompressionFormatMatch: true,
|
||||
compressionFormat: &instance.cloneCompressionVariant.Algorithm,
|
||||
compressionLevel: instance.cloneCompressionVariant.Level})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("replicating image %d/%d from manifest list: %w", i+1, len(instanceCopyList), err)
|
||||
}
|
||||
// Record the result of a possible conversion here.
|
||||
instanceEdits = append(instanceEdits, internalManifest.ListEdit{
|
||||
ListOperation: internalManifest.ListOpAdd,
|
||||
AddDigest: updated.manifestDigest,
|
||||
AddSize: int64(len(updated.manifest)),
|
||||
AddMediaType: updated.manifestMIMEType,
|
||||
AddPlatform: instance.clonePlatform,
|
||||
AddAnnotations: instance.cloneAnnotations,
|
||||
AddCompressionAlgorithms: updated.compressionAlgorithms,
|
||||
})
|
||||
default:
|
||||
return nil, fmt.Errorf("copying image: invalid copy operation %d", instance.op)
|
||||
}
|
||||
|
2
vendor/github.com/containers/image/v5/docker/policyconfiguration/naming.go
generated
vendored
2
vendor/github.com/containers/image/v5/docker/policyconfiguration/naming.go
generated
vendored
@ -40,7 +40,7 @@ func DockerReferenceNamespaces(ref reference.Named) []string {
|
||||
// then in its parent "docker.io/library"; in none of "busybox",
|
||||
// un-namespaced "library" nor in "" supposedly implicitly representing "library/".
|
||||
//
|
||||
// ref.FullName() == ref.Hostname() + "/" + ref.RemoteName(), so the last
|
||||
// ref.Name() == ref.Domain() + "/" + ref.Path(), so the last
|
||||
// iteration matches the host name (for any namespace).
|
||||
res := []string{}
|
||||
name := ref.Name()
|
||||
|
6
vendor/github.com/containers/image/v5/internal/set/set.go
generated
vendored
6
vendor/github.com/containers/image/v5/internal/set/set.go
generated
vendored
@ -28,6 +28,12 @@ func (s *Set[E]) Add(v E) {
|
||||
s.m[v] = struct{}{} // Possibly writing the same struct{}{} presence marker again.
|
||||
}
|
||||
|
||||
func (s *Set[E]) AddSlice(slice []E) {
|
||||
for _, v := range slice {
|
||||
s.Add(v)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Set[E]) Delete(v E) {
|
||||
delete(s.m, v)
|
||||
}
|
||||
|
11
vendor/github.com/containers/image/v5/transports/alltransports/alltransports.go
generated
vendored
11
vendor/github.com/containers/image/v5/transports/alltransports/alltransports.go
generated
vendored
@ -4,8 +4,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
// register all known transports
|
||||
// NOTE: Make sure docs/containers-policy.json.5.md is updated when adding or updating
|
||||
"github.com/containers/image/v5/transports"
|
||||
"github.com/containers/image/v5/types"
|
||||
|
||||
// Register all known transports.
|
||||
// NOTE: Make sure docs/containers-transports.5.md and docs/containers-policy.json.5.md are updated when adding or updating
|
||||
// a transport.
|
||||
_ "github.com/containers/image/v5/directory"
|
||||
_ "github.com/containers/image/v5/docker"
|
||||
@ -15,11 +18,9 @@ import (
|
||||
_ "github.com/containers/image/v5/openshift"
|
||||
_ "github.com/containers/image/v5/sif"
|
||||
_ "github.com/containers/image/v5/tarball"
|
||||
|
||||
// The docker-daemon transport is registeredy by docker_daemon*.go
|
||||
// The ostree transport is registered by ostree*.go
|
||||
// The storage transport is registered by storage*.go
|
||||
"github.com/containers/image/v5/transports"
|
||||
"github.com/containers/image/v5/types"
|
||||
)
|
||||
|
||||
// ParseImageName converts a URL-like image name to a types.ImageReference.
|
||||
|
7
vendor/github.com/vbatts/tar-split/archive/tar/reader.go
generated
vendored
7
vendor/github.com/vbatts/tar-split/archive/tar/reader.go
generated
vendored
@ -7,7 +7,6 @@ package tar
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@ -140,7 +139,7 @@ func (tr *Reader) next() (*Header, error) {
|
||||
continue // This is a meta header affecting the next header
|
||||
case TypeGNULongName, TypeGNULongLink:
|
||||
format.mayOnlyBe(FormatGNU)
|
||||
realname, err := ioutil.ReadAll(tr)
|
||||
realname, err := io.ReadAll(tr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -334,7 +333,7 @@ func mergePAX(hdr *Header, paxHdrs map[string]string) (err error) {
|
||||
// parsePAX parses PAX headers.
|
||||
// If an extended header (type 'x') is invalid, ErrHeader is returned
|
||||
func parsePAX(r io.Reader) (map[string]string, error) {
|
||||
buf, err := ioutil.ReadAll(r)
|
||||
buf, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -916,7 +915,7 @@ func discard(tr *Reader, n int64) error {
|
||||
}
|
||||
}
|
||||
|
||||
copySkipped, err = io.CopyN(ioutil.Discard, r, n-seekSkipped)
|
||||
copySkipped, err = io.CopyN(io.Discard, r, n-seekSkipped)
|
||||
out:
|
||||
if err == io.EOF && seekSkipped+copySkipped < n {
|
||||
err = io.ErrUnexpectedEOF
|
||||
|
16
vendor/github.com/vbatts/tar-split/tar/asm/disassemble.go
generated
vendored
16
vendor/github.com/vbatts/tar-split/tar/asm/disassemble.go
generated
vendored
@ -135,13 +135,15 @@ func NewInputTarStream(r io.Reader, p storage.Packer, fp storage.FilePutter) (io
|
||||
}
|
||||
isEOF = true
|
||||
}
|
||||
_, err = p.AddEntry(storage.Entry{
|
||||
Type: storage.SegmentType,
|
||||
Payload: paddingChunk[:n],
|
||||
})
|
||||
if err != nil {
|
||||
pW.CloseWithError(err)
|
||||
return
|
||||
if n != 0 {
|
||||
_, err = p.AddEntry(storage.Entry{
|
||||
Type: storage.SegmentType,
|
||||
Payload: paddingChunk[:n],
|
||||
})
|
||||
if err != nil {
|
||||
pW.CloseWithError(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
if isEOF {
|
||||
break
|
||||
|
17
vendor/github.com/vbatts/tar-split/tar/storage/packer.go
generated
vendored
17
vendor/github.com/vbatts/tar-split/tar/storage/packer.go
generated
vendored
@ -24,13 +24,6 @@ type Unpacker interface {
|
||||
Next() (*Entry, error)
|
||||
}
|
||||
|
||||
/* TODO(vbatts) figure out a good model for this
|
||||
type PackUnpacker interface {
|
||||
Packer
|
||||
Unpacker
|
||||
}
|
||||
*/
|
||||
|
||||
type jsonUnpacker struct {
|
||||
seen seenNames
|
||||
dec *json.Decoder
|
||||
@ -115,13 +108,3 @@ func NewJSONPacker(w io.Writer) Packer {
|
||||
seen: seenNames{},
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
TODO(vbatts) perhaps have a more compact packer/unpacker, maybe using msgapck
|
||||
(https://github.com/ugorji/go)
|
||||
|
||||
|
||||
Even though, since our jsonUnpacker and jsonPacker just take
|
||||
io.Reader/io.Writer, then we can get away with passing them a
|
||||
gzip.Reader/gzip.Writer
|
||||
*/
|
||||
|
10
vendor/modules.txt
vendored
10
vendor/modules.txt
vendored
@ -109,7 +109,7 @@ github.com/container-orchestrated-devices/container-device-interface/specs-go
|
||||
# github.com/containerd/cgroups v1.1.0
|
||||
## explicit; go 1.17
|
||||
github.com/containerd/cgroups/stats/v1
|
||||
# github.com/containerd/containerd v1.7.2
|
||||
# github.com/containerd/containerd v1.7.3
|
||||
## explicit; go 1.19
|
||||
github.com/containerd/containerd/errdefs
|
||||
github.com/containerd/containerd/log
|
||||
@ -157,7 +157,7 @@ github.com/containers/buildah/pkg/rusage
|
||||
github.com/containers/buildah/pkg/sshagent
|
||||
github.com/containers/buildah/pkg/util
|
||||
github.com/containers/buildah/util
|
||||
# github.com/containers/common v0.55.1-0.20230726131109-ff8298511408
|
||||
# github.com/containers/common v0.55.1-0.20230801150045-44bfd82e3ed2
|
||||
## explicit; go 1.18
|
||||
github.com/containers/common/libimage
|
||||
github.com/containers/common/libimage/define
|
||||
@ -215,7 +215,7 @@ github.com/containers/common/version
|
||||
# github.com/containers/conmon v2.0.20+incompatible
|
||||
## explicit
|
||||
github.com/containers/conmon/runner/config
|
||||
# github.com/containers/image/v5 v5.26.1-0.20230721194716-30c87d4a5b8d
|
||||
# github.com/containers/image/v5 v5.26.1-0.20230726142307-8c387a14f4ac
|
||||
## explicit; go 1.18
|
||||
github.com/containers/image/v5/copy
|
||||
github.com/containers/image/v5/directory
|
||||
@ -973,8 +973,8 @@ github.com/ulikunitz/xz
|
||||
github.com/ulikunitz/xz/internal/hash
|
||||
github.com/ulikunitz/xz/internal/xlog
|
||||
github.com/ulikunitz/xz/lzma
|
||||
# github.com/vbatts/tar-split v0.11.3
|
||||
## explicit; go 1.15
|
||||
# github.com/vbatts/tar-split v0.11.5
|
||||
## explicit; go 1.17
|
||||
github.com/vbatts/tar-split/archive/tar
|
||||
github.com/vbatts/tar-split/tar/asm
|
||||
github.com/vbatts/tar-split/tar/storage
|
||||
|
Reference in New Issue
Block a user