Merge pull request #20016 from flouthoc/test-rmi-wo-layer

test: rmi should work with images w/o layers
This commit is contained in:
OpenShift Merge Robot
2023-09-19 14:15:15 +02:00
committed by GitHub
9 changed files with 33 additions and 11 deletions

2
go.mod
View File

@ -13,7 +13,7 @@ require (
github.com/containernetworking/cni v1.1.2
github.com/containernetworking/plugins v1.3.0
github.com/containers/buildah v1.32.0
github.com/containers/common v0.56.0
github.com/containers/common v0.56.1-0.20230919073449-d1d9d38d8282
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.28.0
github.com/containers/libhvee v0.4.1-0.20230905135638-56fb23533417

4
go.sum
View File

@ -249,8 +249,8 @@ 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.32.0 h1:uz5Rcf7lGeStj7iPTBgO4UdhQYZqMMzyt9suDf16k1k=
github.com/containers/buildah v1.32.0/go.mod h1:sN3rA3DbnqekNz3bNdkqWduuirYDuMs54LUCOZOomBE=
github.com/containers/common v0.56.0 h1:hysHUsEai1EkMXanU26UV55wMXns/a6AYmaFqJ4fEMY=
github.com/containers/common v0.56.0/go.mod h1:IjaDdfUtcs2CfCcJMZxuut4XlvkTkY9Nlqkso9xCOq4=
github.com/containers/common v0.56.1-0.20230919073449-d1d9d38d8282 h1:GkMoKMmH4EhjdCNk1jYGWC0pTa+SFdp6fas64nPOPyY=
github.com/containers/common v0.56.1-0.20230919073449-d1d9d38d8282/go.mod h1:NKWo6OWVItRwJjqu30vd4uFG3bBKUL9q+B38GNwY/bo=
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.28.0 h1:H4cWbdI88UA/mDb6SxMo3IxpmS1BSs/Kifvhwt9g048=

View File

@ -122,7 +122,7 @@ EOF
run_podman manifest create $manifestlocal
for arch in amd arm;do
# FIXME: --layers=false needed to work around #19860
run_podman build --layers=false -t image_$arch --platform linux/${arch}64 -f $dockerfile
run_podman build -t image_$arch --platform linux/${arch}64 -f $dockerfile
run_podman manifest add $manifestlocal containers-storage:localhost/image_$arch:latest
done

View File

@ -199,6 +199,17 @@ func (t *layerTree) children(ctx context.Context, parent *Image, all bool) ([]*I
if parent.TopLayer() == "" {
for i := range t.emptyImages {
empty := t.emptyImages[i]
isManifest, err := empty.IsManifestList(ctx)
if err != nil {
return nil, err
}
if isManifest {
// If this is a manifest list and is already
// marked as empty then no instance can be
// selected from this list therefore its
// better to skip this.
continue
}
isParent, err := checkParent(empty)
if err != nil {
return nil, err
@ -289,6 +300,17 @@ func (t *layerTree) parent(ctx context.Context, child *Image) (*Image, error) {
if childID == empty.ID() {
continue
}
isManifest, err := empty.IsManifestList(ctx)
if err != nil {
return nil, err
}
if isManifest {
// If this is a manifest list and is already
// marked as empty then no instance can be
// selected from this list therefore its
// better to skip this.
continue
}
emptyOCI, err := t.toOCI(ctx, empty)
if err != nil {
if ErrorIsImageUnknown(err) {

View File

@ -669,8 +669,8 @@ default_sysctls = [
# [engine.service_destinations.production]
# URI to access the Podman service
# Examples:
# rootless "unix://run/user/$UID/podman/podman.sock" (Default)
# rootful "unix://run/podman/podman.sock (Default)
# rootless "unix:///run/user/$UID/podman/podman.sock" (Default)
# rootful "unix:///run/podman/podman.sock (Default)
# remote rootless ssh://engineering.lab.company.com/run/user/1000/podman/podman.sock
# remote rootful ssh://root@10.10.1.136:22/run/podman/podman.sock
#

View File

@ -541,8 +541,8 @@ default_sysctls = [
# [service_destinations.production]
# URI to access the Podman service
# Examples:
# rootless "unix://run/user/$UID/podman/podman.sock" (Default)
# rootful "unix://run/podman/podman.sock (Default)
# rootless "unix:///run/user/$UID/podman/podman.sock" (Default)
# rootful "unix:///run/podman/podman.sock (Default)
# remote rootless ssh://engineering.lab.company.com/run/user/1000/podman/podman.sock
# remote rootful ssh://root@10.10.1.136:22/run/podman/podman.sock
#

View File

@ -268,7 +268,7 @@ func defaultFarmConfig() FarmConfig {
}
}
// defaultEngineConfig eturns a default engine configuration. Note that the
// defaultEngineConfig returns a default engine configuration. Note that the
// config is different for root and rootless. It also parses the storage.conf.
func defaultEngineConfig() (*EngineConfig, error) {
c := new(EngineConfig)

View File

@ -1,4 +1,4 @@
package version
// Version is the version of the build.
const Version = "0.56.0"
const Version = "0.56.1-dev"

2
vendor/modules.txt vendored
View File

@ -164,7 +164,7 @@ github.com/containers/buildah/pkg/sshagent
github.com/containers/buildah/pkg/util
github.com/containers/buildah/pkg/volumes
github.com/containers/buildah/util
# github.com/containers/common v0.56.0
# github.com/containers/common v0.56.1-0.20230919073449-d1d9d38d8282
## explicit; go 1.18
github.com/containers/common/libimage
github.com/containers/common/libimage/define