mirror of
https://github.com/containers/skopeo.git
synced 2025-09-27 13:13:52 +00:00
Bump c/storage to v1.24.8 and c/image to v5.10.5 for RHEL 8.4 in release-1.2
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
43
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
43
vendor/github.com/containers/image/v5/copy/copy.go
generated
vendored
@@ -1067,6 +1067,26 @@ type diffIDResult struct {
|
||||
// copyLayer copies a layer with srcInfo (with known Digest and Annotations and possibly known Size) in src to dest, perhaps (de/re/)compressing it,
|
||||
// and returns a complete blobInfo of the copied layer, and a value for LayerDiffIDs if diffIDIsNeeded
|
||||
func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, toEncrypt bool, pool *mpb.Progress) (types.BlobInfo, digest.Digest, error) {
|
||||
// If the srcInfo doesn't contain compression information, try to compute it from the
|
||||
// MediaType, which was either read from a manifest by way of LayerInfos() or constructed
|
||||
// by LayerInfosForCopy(), if it was supplied at all. If we succeed in copying the blob,
|
||||
// the BlobInfo we return will be passed to UpdatedImage() and then to UpdateLayerInfos(),
|
||||
// which uses the compression information to compute the updated MediaType values.
|
||||
// (Sadly UpdatedImage() is documented to not update MediaTypes from
|
||||
// ManifestUpdateOptions.LayerInfos[].MediaType, so we are doing it indirectly.)
|
||||
//
|
||||
// This MIME type → compression mapping belongs in manifest-specific code in our manifest
|
||||
// package (but we should preferably replace/change UpdatedImage instead of productizing
|
||||
// this workaround).
|
||||
if srcInfo.CompressionAlgorithm == nil {
|
||||
switch srcInfo.MediaType {
|
||||
case manifest.DockerV2Schema2LayerMediaType, imgspecv1.MediaTypeImageLayerGzip:
|
||||
srcInfo.CompressionAlgorithm = &compression.Gzip
|
||||
case imgspecv1.MediaTypeImageLayerZstd:
|
||||
srcInfo.CompressionAlgorithm = &compression.Zstd
|
||||
}
|
||||
}
|
||||
|
||||
cachedDiffID := ic.c.blobInfoCache.UncompressedDigest(srcInfo.Digest) // May be ""
|
||||
// Diffs are needed if we are encrypting an image or trying to decrypt an image
|
||||
diffIDIsNeeded := ic.diffIDsAreNeeded && cachedDiffID == "" || toEncrypt || (isOciEncrypted(srcInfo.MediaType) && ic.c.ociDecryptConfig != nil)
|
||||
@@ -1095,6 +1115,19 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo, to
|
||||
Artifact: srcInfo,
|
||||
}
|
||||
}
|
||||
|
||||
// If the reused blob has the same digest as the one we asked for, but
|
||||
// the transport didn't/couldn't supply compression info, fill it in based
|
||||
// on what we know from the srcInfos we were given.
|
||||
// If the srcInfos came from LayerInfosForCopy(), then UpdatedImage() will
|
||||
// call UpdateLayerInfos(), which uses this information to compute the
|
||||
// MediaType value for the updated layer infos, and it the transport
|
||||
// didn't pass the information along from its input to its output, then
|
||||
// it can derive the MediaType incorrectly.
|
||||
if blobInfo.Digest == srcInfo.Digest && blobInfo.CompressionAlgorithm == nil {
|
||||
blobInfo.CompressionOperation = srcInfo.CompressionOperation
|
||||
blobInfo.CompressionAlgorithm = srcInfo.CompressionAlgorithm
|
||||
}
|
||||
return blobInfo, cachedDiffID, nil
|
||||
}
|
||||
}
|
||||
@@ -1349,7 +1382,15 @@ func (c *copier) copyBlobFromStream(ctx context.Context, srcStream io.Reader, sr
|
||||
compressionOperation = types.PreserveOriginal
|
||||
inputInfo = srcInfo
|
||||
uploadCompressorName = srcCompressorName
|
||||
uploadCompressionFormat = nil
|
||||
// Remember if the original blob was compressed, and if so how, so that if
|
||||
// LayerInfosForCopy() returned something that differs from what was in the
|
||||
// source's manifest, and UpdatedImage() needs to call UpdateLayerInfos(),
|
||||
// it will be able to correctly derive the MediaType for the copied blob.
|
||||
if isCompressed {
|
||||
uploadCompressionFormat = &compressionFormat
|
||||
} else {
|
||||
uploadCompressionFormat = nil
|
||||
}
|
||||
}
|
||||
|
||||
// Perform image encryption for valid mediatypes if ociEncryptConfig provided
|
||||
|
12
vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go
generated
vendored
12
vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go
generated
vendored
@@ -34,15 +34,9 @@ func shortNameAliasesConfPath(ctx *types.SystemContext) (string, error) {
|
||||
}
|
||||
|
||||
// Rootless user
|
||||
var cacheRoot string
|
||||
if xdgCache := os.Getenv("XDG_CACHE_HOME"); xdgCache != "" {
|
||||
cacheRoot = xdgCache
|
||||
} else {
|
||||
configHome, err := homedir.GetConfigHome()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
cacheRoot = filepath.Join(configHome, ".cache")
|
||||
cacheRoot, err := homedir.GetCacheHome()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return filepath.Join(cacheRoot, userShortNamesFile), nil
|
||||
|
3
vendor/github.com/containers/image/v5/storage/storage_image.go
generated
vendored
3
vendor/github.com/containers/image/v5/storage/storage_image.go
generated
vendored
@@ -246,8 +246,7 @@ func (s *storageImageSource) LayerInfosForCopy(ctx context.Context, instanceDige
|
||||
case imgspecv1.MediaTypeImageManifest:
|
||||
uncompressedLayerType = imgspecv1.MediaTypeImageLayer
|
||||
case manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1SignedMediaType, manifest.DockerV2Schema2MediaType:
|
||||
// This is actually a compressed type, but there's no uncompressed type defined
|
||||
uncompressedLayerType = manifest.DockerV2Schema2LayerMediaType
|
||||
uncompressedLayerType = manifest.DockerV2SchemaLayerMediaTypeUncompressed
|
||||
}
|
||||
|
||||
physicalBlobInfos := []types.BlobInfo{}
|
||||
|
2
vendor/github.com/containers/image/v5/version/version.go
generated
vendored
2
vendor/github.com/containers/image/v5/version/version.go
generated
vendored
@@ -8,7 +8,7 @@ const (
|
||||
// VersionMinor is for functionality in a backwards-compatible manner
|
||||
VersionMinor = 10
|
||||
// VersionPatch is for backwards-compatible bug fixes
|
||||
VersionPatch = 2
|
||||
VersionPatch = 5
|
||||
|
||||
// VersionDev indicates development branch. Releases will be empty string.
|
||||
VersionDev = ""
|
||||
|
2
vendor/github.com/containers/storage/VERSION
generated
vendored
2
vendor/github.com/containers/storage/VERSION
generated
vendored
@@ -1 +1 @@
|
||||
1.24.6
|
||||
1.24.8
|
||||
|
4
vendor/github.com/containers/storage/drivers/overlay/check.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/overlay/check.go
generated
vendored
@@ -145,6 +145,10 @@ func doesMetacopy(d, mountOpts string) (bool, error) {
|
||||
opts = fmt.Sprintf("%s,%s", opts, data)
|
||||
}
|
||||
if err := unix.Mount("overlay", filepath.Join(td, "merged"), "overlay", uintptr(flags), opts); err != nil {
|
||||
if errors.Cause(err) == unix.EINVAL {
|
||||
logrus.Info("metacopy option not supported on this kernel", mountOpts)
|
||||
return false, nil
|
||||
}
|
||||
return false, errors.Wrapf(err, "failed to mount overlay for metacopy check with %q options", mountOpts)
|
||||
}
|
||||
defer func() {
|
||||
|
22
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
22
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@@ -750,8 +750,22 @@ func (d *Driver) getLowerDirs(id string) ([]string, error) {
|
||||
for _, s := range strings.Split(string(lowers), ":") {
|
||||
lower := d.dir(s)
|
||||
lp, err := os.Readlink(lower)
|
||||
// if the link does not exist, we lost the symlinks during a sudden reboot.
|
||||
// Let's go ahead and recreate those symlinks.
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if os.IsNotExist(err) {
|
||||
logrus.Warnf("Can't read link %q because it does not exist. Going through storage to recreate the missing symlinks.", lower)
|
||||
if err := d.recreateSymlinks(); err != nil {
|
||||
return nil, fmt.Errorf("error recreating the missing symlinks: %v", err)
|
||||
}
|
||||
// let's call Readlink on lower again now that we have recreated the missing symlinks
|
||||
lp, err = os.Readlink(lower)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
lowersArray = append(lowersArray, path.Clean(d.dir(path.Join("link", lp))))
|
||||
}
|
||||
@@ -879,7 +893,11 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
|
||||
// If metacopy=on is present in d.options.mountOptions it must be present in the mount
|
||||
// options otherwise the kernel refuses to follow the metacopy xattr.
|
||||
if hasMetacopyOption(strings.Split(d.options.mountOptions, ",")) && !hasMetacopyOption(options.Options) {
|
||||
optsList = append(optsList, "metacopy=on")
|
||||
if d.usingMetacopy {
|
||||
optsList = append(optsList, "metacopy=on")
|
||||
} else {
|
||||
logrus.Warnf("ignoring metacopy option from storage.conf, not supported with booted kernel")
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, o := range optsList {
|
||||
|
5
vendor/github.com/containers/storage/pkg/homedir/homedir_others.go
generated
vendored
5
vendor/github.com/containers/storage/pkg/homedir/homedir_others.go
generated
vendored
@@ -28,3 +28,8 @@ func GetDataHome() (string, error) {
|
||||
func GetConfigHome() (string, error) {
|
||||
return "", errors.New("homedir.GetConfigHome() is not supported on this system")
|
||||
}
|
||||
|
||||
// GetCacheHome is unsupported on non-linux system.
|
||||
func GetCacheHome() (string, error) {
|
||||
return "", errors.New("homedir.GetCacheHome() is not supported on this system")
|
||||
}
|
||||
|
15
vendor/github.com/containers/storage/pkg/homedir/homedir_unix.go
generated
vendored
15
vendor/github.com/containers/storage/pkg/homedir/homedir_unix.go
generated
vendored
@@ -123,3 +123,18 @@ func GetConfigHome() (string, error) {
|
||||
}
|
||||
return filepath.Join(home, ".config"), nil
|
||||
}
|
||||
|
||||
// GetCacheHome returns XDG_CACHE_HOME.
|
||||
// GetCacheHome returns $HOME/.cache and nil error if XDG_CACHE_HOME is not set.
|
||||
//
|
||||
// See also https://standards.freedesktop.org/basedir-spec/latest/ar01s03.html
|
||||
func GetCacheHome() (string, error) {
|
||||
if xdgCacheHome := os.Getenv("XDG_CACHE_HOME"); xdgCacheHome != "" {
|
||||
return xdgCacheHome, nil
|
||||
}
|
||||
home := Get()
|
||||
if home == "" {
|
||||
return "", errors.New("could not get either XDG_CACHE_HOME or HOME")
|
||||
}
|
||||
return filepath.Join(home, ".cache"), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user