Vendor c/common:8483ef6022b4

This commit vendor pre-release version of `c/common:8483ef6022b4`.
It also adapts the code to the new `c/common/libimage` API, which
fixes an image listing race that was listing false warnings.

fixes: #23331

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
Jan Rodák
2024-08-29 16:41:30 +02:00
parent f013ebe447
commit c6fe5e5395
175 changed files with 11890 additions and 1980 deletions

View File

@@ -11,7 +11,7 @@ import (
"strings"
"time"
"github.com/containerd/containerd/platforms"
"github.com/containerd/platforms"
"github.com/containers/common/libimage/platform"
"github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/manifest"
@@ -257,7 +257,7 @@ func (i *Image) TopLayer() string {
// Parent returns the parent image or nil if there is none
func (i *Image) Parent(ctx context.Context) (*Image, error) {
tree, err := i.runtime.layerTree(ctx, nil)
tree, err := i.runtime.newFreshLayerTree()
if err != nil {
return nil, err
}
@@ -291,7 +291,7 @@ func (i *Image) Children(ctx context.Context) ([]*Image, error) {
// created for this invocation only.
func (i *Image) getChildren(ctx context.Context, all bool, tree *layerTree) ([]*Image, error) {
if tree == nil {
t, err := i.runtime.layerTree(ctx, nil)
t, err := i.runtime.newFreshLayerTree()
if err != nil {
return nil, err
}