go.mod: update osbuild/images to v0.168.0
tag v0.165.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 0.165.0 ---------------- * distro: move rhel9 into a generic distro (osbuild/images#1645) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger * Revert "distro: drop `ImageType.BasePartitionTable()`" (osbuild/images#1691) * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza * Update dependencies 2025-07-20 (osbuild/images#1675) * Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger * defs: add missing `bootstrap_containers` (osbuild/images#1679) * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza * disk: handle adding `PReP` partition on PPC64/s390x (HMS-8884) (osbuild/images#1681) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger * distro: bring per-distro checkOptions back (osbuild/images#1678) * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza * distro: cleanups in the pkg/distro/generic area (osbuild/images#1686) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger * distro: move rhel8 into a generic distro (osbuild/images#1643) * Author: Michael Vogt, Reviewers: Nobody * distro: small followups for PR#1682 (osbuild/images#1689) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger, Tomáš Hozza * distro: unify transform/match into a single concept (osbuild/images#1682) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Tomáš Hozza * distros: de-duplicate runner build packages for centos10 (osbuild/images#1680) * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza * github: disable Go dep updates through dependabot (osbuild/images#1683) * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza * repos: include almalinux 9.6 (osbuild/images#1677) * Author: Simon de Vlieger, Reviewers: Lukáš Zapletal, Tomáš Hozza * rhel9: wsl distribution config (osbuild/images#1694) * Author: Simon de Vlieger, Reviewers: Michael Vogt, Sanne Raymaekers * test/manifests/all-customizations: don't embed local file via URI (osbuild/images#1684) * Author: Tomáš Hozza, Reviewers: Achilleas Koutsou, Brian C. Lane — Somewhere on the Internet, 2025-07-28 --- tag v0.166.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 0.166.0 ---------------- * customizations/subscription: conditionally enable semanage call (HMS-8866) (osbuild/images#1673) * Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Michael Vogt * distro/rhel-10: versionlock shim-x64 in the azure-cvm image (osbuild/images#1697) * Author: Achilleas Koutsou, Reviewers: Michael Vogt, Simon de Vlieger * manifestmock: move container/pkg/commit mocks into helper (osbuild/images#1700) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger * rhel9: `vagrant-libvirt`, `vagrant-virtualbox` (osbuild/images#1693) * Author: Simon de Vlieger, Reviewers: Michael Vogt, Sanne Raymaekers * rhel{9,10}: centos WSL refinement (HMS-8922) (osbuild/images#1690) * Author: Simon de Vlieger, Reviewers: Ondřej Budai, Sanne Raymaekers, Tomáš Hozza — Somewhere on the Internet, 2025-07-29 --- tag v0.167.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 0.167.0 ---------------- * RHEL/Azure: drop obsolete WAAgentConfig keys [RHEL-93894] and remove loglevel kernel option [RHEL-102372] (osbuild/images#1611) * Author: Achilleas Koutsou, Reviewers: Michael Vogt, Ondřej Budai, Sanne Raymaekers * Update dependencies 2025-07-27 (osbuild/images#1699) * Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger * distro/rhel9: set default_kernel to kernel-uki-virt (osbuild/images#1704) * Author: Achilleas Koutsou, Reviewers: Ondřej Budai, Simon de Vlieger * distro: drop legacy loaders and update tests (osbuild/images#1687) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Tomáš Hozza * distro: fix issues with yaml distro definitions and enable yaml checks (osbuild/images#1702) * Author: Achilleas Koutsou, Reviewers: Michael Vogt, Ondřej Budai, Simon de Vlieger — Somewhere on the Internet, 2025-07-30 --- tag v0.168.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 0.168.0 ---------------- * distro: fix bug in variable substitution for static distros (osbuild/images#1710) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger * rhel{9,10}: azure for non-RHEL (HMS-8949) (osbuild/images#1707) * Author: Simon de Vlieger, Reviewers: Achilleas Koutsou, Michael Vogt — Somewhere on the Internet, 2025-07-30 ---
This commit is contained in:
parent
fad3b35d49
commit
6497b7520d
856 changed files with 72834 additions and 136836 deletions
106
vendor/github.com/containers/storage/layers.go
generated
vendored
106
vendor/github.com/containers/storage/layers.go
generated
vendored
|
|
@ -18,6 +18,7 @@ import (
|
|||
"time"
|
||||
|
||||
drivers "github.com/containers/storage/drivers"
|
||||
"github.com/containers/storage/internal/tempdir"
|
||||
"github.com/containers/storage/pkg/archive"
|
||||
"github.com/containers/storage/pkg/idtools"
|
||||
"github.com/containers/storage/pkg/ioutils"
|
||||
|
|
@ -38,6 +39,8 @@ import (
|
|||
|
||||
const (
|
||||
tarSplitSuffix = ".tar-split.gz"
|
||||
// tempDirPath is the subdirectory name used for storing temporary directories during layer deletion
|
||||
tempDirPath = "tmp"
|
||||
incompleteFlag = "incomplete"
|
||||
// maxLayerStoreCleanupIterations is the number of times we try to clean up inconsistent layer store state
|
||||
// in readers (which, for implementation reasons, gives other writers the opportunity to create more inconsistent state)
|
||||
|
|
@ -290,8 +293,14 @@ type rwLayerStore interface {
|
|||
// updateNames modifies names associated with a layer based on (op, names).
|
||||
updateNames(id string, names []string, op updateNameOperation) error
|
||||
|
||||
// Delete deletes a layer with the specified name or ID.
|
||||
Delete(id string) error
|
||||
// deleteWhileHoldingLock deletes a layer with the specified name or ID.
|
||||
deleteWhileHoldingLock(id string) error
|
||||
|
||||
// deferredDelete deletes a layer with the specified name or ID.
|
||||
// This removal happen immediately (the layer is no longer usable),
|
||||
// but physically deleting the files may be deferred.
|
||||
// Caller MUST call all returned cleanup functions outside of the locks.
|
||||
deferredDelete(id string) ([]tempdir.CleanupTempDirFunc, error)
|
||||
|
||||
// Wipe deletes all layers.
|
||||
Wipe() error
|
||||
|
|
@ -794,6 +803,17 @@ func (r *layerStore) load(lockedForWriting bool) (bool, error) {
|
|||
layers := []*Layer{}
|
||||
ids := make(map[string]*Layer)
|
||||
|
||||
if r.lockfile.IsReadWrite() {
|
||||
if err := tempdir.RecoverStaleDirs(filepath.Join(r.layerdir, tempDirPath)); err != nil {
|
||||
return false, err
|
||||
}
|
||||
for _, driverTempDirPath := range r.driver.GetTempDirRootDirs() {
|
||||
if err := tempdir.RecoverStaleDirs(driverTempDirPath); err != nil {
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for locationIndex := range numLayerLocationIndex {
|
||||
location := layerLocationFromIndex(locationIndex)
|
||||
rpath := r.jsonPath[locationIndex]
|
||||
|
|
@ -935,7 +955,12 @@ func (r *layerStore) load(lockedForWriting bool) (bool, error) {
|
|||
// Now actually delete the layers
|
||||
for _, layer := range layersToDelete {
|
||||
logrus.Warnf("Found incomplete layer %q, deleting it", layer.ID)
|
||||
err := r.deleteInternal(layer.ID)
|
||||
cleanFunctions, err := r.internalDelete(layer.ID)
|
||||
defer func() {
|
||||
if err := tempdir.CleanupTemporaryDirectories(cleanFunctions...); err != nil {
|
||||
logrus.Errorf("Error cleaning up temporary directories: %v", err)
|
||||
}
|
||||
}()
|
||||
if err != nil {
|
||||
// Don't return the error immediately, because deleteInternal does not saveLayers();
|
||||
// Even if deleting one incomplete layer fails, call saveLayers() so that other possible successfully
|
||||
|
|
@ -1334,7 +1359,7 @@ func (r *layerStore) PutAdditionalLayer(id string, parentLayer *Layer, names []s
|
|||
r.bytocsum[layer.TOCDigest] = append(r.bytocsum[layer.TOCDigest], layer.ID)
|
||||
}
|
||||
if err := r.saveFor(layer); err != nil {
|
||||
if e := r.Delete(layer.ID); e != nil {
|
||||
if e := r.deleteWhileHoldingLock(layer.ID); e != nil {
|
||||
logrus.Errorf("While recovering from a failure to save layers, error deleting layer %#v: %v", id, e)
|
||||
}
|
||||
return nil, err
|
||||
|
|
@ -1469,7 +1494,7 @@ func (r *layerStore) create(id string, parentLayer *Layer, names []string, mount
|
|||
if cleanupFailureContext == "" {
|
||||
cleanupFailureContext = "unknown: cleanupFailureContext not set at the failure site"
|
||||
}
|
||||
if e := r.Delete(id); e != nil {
|
||||
if e := r.deleteWhileHoldingLock(id); e != nil {
|
||||
logrus.Errorf("While recovering from a failure (%s), error deleting layer %#v: %v", cleanupFailureContext, id, e)
|
||||
}
|
||||
}
|
||||
|
|
@ -1634,7 +1659,7 @@ func (r *layerStore) Mount(id string, options drivers.MountOpts) (string, error)
|
|||
options.MountLabel = layer.MountLabel
|
||||
}
|
||||
|
||||
if (options.UidMaps != nil || options.GidMaps != nil) && !r.driver.SupportsShifting() {
|
||||
if (options.UidMaps != nil || options.GidMaps != nil) && !r.driver.SupportsShifting(options.UidMaps, options.GidMaps) {
|
||||
if !reflect.DeepEqual(options.UidMaps, layer.UIDMap) || !reflect.DeepEqual(options.GidMaps, layer.GIDMap) {
|
||||
return "", fmt.Errorf("cannot mount layer %v: shifting not enabled", layer.ID)
|
||||
}
|
||||
|
|
@ -1920,13 +1945,15 @@ func layerHasIncompleteFlag(layer *Layer) bool {
|
|||
}
|
||||
|
||||
// Requires startWriting.
|
||||
func (r *layerStore) deleteInternal(id string) error {
|
||||
// Caller MUST run all returned cleanup functions after this, EVEN IF the function returns an error.
|
||||
// Ideally outside of the startWriting.
|
||||
func (r *layerStore) internalDelete(id string) ([]tempdir.CleanupTempDirFunc, error) {
|
||||
if !r.lockfile.IsReadWrite() {
|
||||
return fmt.Errorf("not allowed to delete layers at %q: %w", r.layerdir, ErrStoreIsReadOnly)
|
||||
return nil, fmt.Errorf("not allowed to delete layers at %q: %w", r.layerdir, ErrStoreIsReadOnly)
|
||||
}
|
||||
layer, ok := r.lookup(id)
|
||||
if !ok {
|
||||
return ErrLayerUnknown
|
||||
return nil, ErrLayerUnknown
|
||||
}
|
||||
// Ensure that if we are interrupted, the layer will be cleaned up.
|
||||
if !layerHasIncompleteFlag(layer) {
|
||||
|
|
@ -1935,16 +1962,30 @@ func (r *layerStore) deleteInternal(id string) error {
|
|||
}
|
||||
layer.Flags[incompleteFlag] = true
|
||||
if err := r.saveFor(layer); err != nil {
|
||||
return err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
// We never unset incompleteFlag; below, we remove the entire object from r.layers.
|
||||
id = layer.ID
|
||||
if err := r.driver.Remove(id); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return err
|
||||
tempDirectory, err := tempdir.NewTempDir(filepath.Join(r.layerdir, tempDirPath))
|
||||
cleanFunctions := []tempdir.CleanupTempDirFunc{}
|
||||
cleanFunctions = append(cleanFunctions, tempDirectory.Cleanup)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
id = layer.ID
|
||||
cleanFunc, err := r.driver.DeferredRemove(id)
|
||||
cleanFunctions = append(cleanFunctions, cleanFunc)
|
||||
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return cleanFunctions, err
|
||||
}
|
||||
|
||||
cleanFunctions = append(cleanFunctions, tempDirectory.Cleanup)
|
||||
if err := tempDirectory.StageDeletion(r.tspath(id)); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return cleanFunctions, err
|
||||
}
|
||||
if err := tempDirectory.StageDeletion(r.datadir(id)); err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
return cleanFunctions, err
|
||||
}
|
||||
os.Remove(r.tspath(id))
|
||||
os.RemoveAll(r.datadir(id))
|
||||
delete(r.byid, id)
|
||||
for _, name := range layer.Names {
|
||||
delete(r.byname, name)
|
||||
|
|
@ -1968,7 +2009,7 @@ func (r *layerStore) deleteInternal(id string) error {
|
|||
}) {
|
||||
selinux.ReleaseLabel(mountLabel)
|
||||
}
|
||||
return nil
|
||||
return cleanFunctions, nil
|
||||
}
|
||||
|
||||
// Requires startWriting.
|
||||
|
|
@ -1988,10 +2029,20 @@ func (r *layerStore) deleteInDigestMap(id string) {
|
|||
}
|
||||
|
||||
// Requires startWriting.
|
||||
func (r *layerStore) Delete(id string) error {
|
||||
// This is soft-deprecated and should not have any new callers; use deferredDelete instead.
|
||||
func (r *layerStore) deleteWhileHoldingLock(id string) error {
|
||||
cleanupFunctions, deferErr := r.deferredDelete(id)
|
||||
cleanupErr := tempdir.CleanupTemporaryDirectories(cleanupFunctions...)
|
||||
return errors.Join(deferErr, cleanupErr)
|
||||
}
|
||||
|
||||
// Requires startWriting.
|
||||
// Caller MUST run all returned cleanup functions after this, EVEN IF the function returns an error.
|
||||
// Ideally outside of the startWriting.
|
||||
func (r *layerStore) deferredDelete(id string) ([]tempdir.CleanupTempDirFunc, error) {
|
||||
layer, ok := r.lookup(id)
|
||||
if !ok {
|
||||
return ErrLayerUnknown
|
||||
return nil, ErrLayerUnknown
|
||||
}
|
||||
id = layer.ID
|
||||
// The layer may already have been explicitly unmounted, but if not, we
|
||||
|
|
@ -2003,13 +2054,14 @@ func (r *layerStore) Delete(id string) error {
|
|||
break
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if err := r.deleteInternal(id); err != nil {
|
||||
return err
|
||||
cleanFunctions, err := r.internalDelete(id)
|
||||
if err != nil {
|
||||
return cleanFunctions, err
|
||||
}
|
||||
return r.saveFor(layer)
|
||||
return cleanFunctions, r.saveFor(layer)
|
||||
}
|
||||
|
||||
// Requires startReading or startWriting.
|
||||
|
|
@ -2039,7 +2091,7 @@ func (r *layerStore) Wipe() error {
|
|||
return r.byid[ids[i]].Created.After(r.byid[ids[j]].Created)
|
||||
})
|
||||
for _, id := range ids {
|
||||
if err := r.Delete(id); err != nil {
|
||||
if err := r.deleteWhileHoldingLock(id); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
@ -2550,10 +2602,14 @@ func (r *layerStore) applyDiffFromStagingDirectory(id string, diffOutput *driver
|
|||
if err != nil {
|
||||
compressor = pgzip.NewWriter(&tsdata)
|
||||
}
|
||||
if _, err := diffOutput.TarSplit.Seek(0, io.SeekStart); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := compressor.SetConcurrency(1024*1024, 1); err != nil { // 1024*1024 is the hard-coded default; we're not changing that
|
||||
logrus.Infof("setting compression concurrency threads to 1: %v; ignoring", err)
|
||||
}
|
||||
if _, err := compressor.Write(diffOutput.TarSplit); err != nil {
|
||||
if _, err := diffOutput.TarSplit.WriteTo(compressor); err != nil {
|
||||
compressor.Close()
|
||||
return err
|
||||
}
|
||||
|
|
@ -2567,7 +2623,7 @@ func (r *layerStore) applyDiffFromStagingDirectory(id string, diffOutput *driver
|
|||
}
|
||||
for k, v := range diffOutput.BigData {
|
||||
if err := r.SetBigData(id, k, bytes.NewReader(v)); err != nil {
|
||||
if err2 := r.Delete(id); err2 != nil {
|
||||
if err2 := r.deleteWhileHoldingLock(id); err2 != nil {
|
||||
logrus.Errorf("While recovering from a failure to set big data, error deleting layer %#v: %v", id, err2)
|
||||
}
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue