Skip to content

Commit

Permalink
vendor containers/common@main
Browse files Browse the repository at this point in the history
The `IgnorePlatform` options has been removed from the
`LookupImageOptions` in libimage to properly support multi-arch images.

Skip one buildah-bud test which requires updated CI images.  This is
currently being done in github.com/containers/pull/10829 but
we need to unblock merging common and buildah into podman.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Jul 16, 2021
1 parent f0cd16c commit e1ac0c3
Show file tree
Hide file tree
Showing 26 changed files with 303 additions and 146 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
github.com/container-orchestrated-devices/container-device-interface v0.0.0-20210325223243-f99e8b6c10b9
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.9.1
github.com/containers/buildah v1.21.1-0.20210628174543-eadb10a12336
github.com/containers/common v0.40.2-0.20210702074932-9d34b37ba77e
github.com/containers/buildah v1.21.1-0.20210707133512-2eb97b499d74
github.com/containers/common v0.40.2-0.20210707094508-0a4a1906d4b2
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.13.2
github.com/containers/ocicrypt v1.1.2
Expand Down
11 changes: 4 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,10 @@ github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHV
github.com/containernetworking/plugins v0.8.7/go.mod h1:R7lXeZaBzpfqapcAbHRW8/CYwm0dHzbz0XEjofx0uB0=
github.com/containernetworking/plugins v0.9.1 h1:FD1tADPls2EEi3flPc2OegIY1M9pUa9r2Quag7HMLV8=
github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8=
github.com/containers/buildah v1.21.1-0.20210628174543-eadb10a12336 h1:LAjAsDE6sxZnDoSzE384o/cRuTGGn1OMjkd9YIPT2bg=
github.com/containers/buildah v1.21.1-0.20210628174543-eadb10a12336/go.mod h1:HZ2k0W/EREpNxr+AnRZQzjjBdhXLItp9yuzwAaVa6zM=
github.com/containers/common v0.40.1/go.mod h1:X4F+6vmeAWKMMTNHlOBwOnkf5TQAkQACcuNsKjfcodw=
github.com/containers/common v0.40.2-0.20210702074932-9d34b37ba77e h1:ubkW5+D74+JrEL6qFmdAQpZ2L1jdGrRYPpkgKdV2YEw=
github.com/containers/common v0.40.2-0.20210702074932-9d34b37ba77e/go.mod h1:dbz5oauwVA4I/9HMe7YQUt6LWUmrYQlwQH9LQ35bm/U=
github.com/containers/buildah v1.21.1-0.20210707133512-2eb97b499d74 h1:u+Wk1Gv+UgOR0AHmlpbH+ZsdfZt7vkGuiKCyhbI4Ga0=
github.com/containers/buildah v1.21.1-0.20210707133512-2eb97b499d74/go.mod h1:P0rxPkI7440rWVMkbPkSHX4j1PxjOcx+cY8QrqYgdLE=
github.com/containers/common v0.40.2-0.20210707094508-0a4a1906d4b2 h1:2ApmOS9jSnJXuSOkZNEAZ7j0/9i8zjoi67b/UpUjPxY=
github.com/containers/common v0.40.2-0.20210707094508-0a4a1906d4b2/go.mod h1:thow5Jn7O+rP01njI9COQ16L9g/KQ1LcMcYqP2NhYCU=
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.13.2 h1:AgYunV/9d2fRkrmo23wH2MkqeHolFd6oQCkK+1PpuFA=
Expand Down Expand Up @@ -844,8 +843,6 @@ github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKv
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
github.com/spf13/cobra v1.2.0/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw=
github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
Expand Down
3 changes: 1 addition & 2 deletions libpod/diff.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package libpod

import (
"github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/libpod/layers"
"github.com/containers/storage/pkg/archive"
Expand Down Expand Up @@ -53,7 +52,7 @@ func (r *Runtime) GetDiff(from, to string, diffType define.DiffType) ([]archive.
func (r *Runtime) getLayerID(id string, diffType define.DiffType) (string, error) {
var lastErr error
if diffType&define.DiffImage == define.DiffImage {
toImage, _, err := r.libimageRuntime.LookupImage(id, &libimage.LookupImageOptions{IgnorePlatform: true})
toImage, _, err := r.libimageRuntime.LookupImage(id, nil)
if err == nil {
return toImage.TopLayer(), nil
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/api/handlers/compat/images_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package compat
import (
"net/http"

"github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/pkg/api/handlers"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
Expand All @@ -14,8 +13,7 @@ func HistoryImage(w http.ResponseWriter, r *http.Request) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
name := utils.GetName(r)

lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
newImage, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions)
newImage, _, err := runtime.LibimageRuntime().LookupImage(name, nil)
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Wrapf(err, "failed to find image %s", name))
return
Expand Down
4 changes: 1 addition & 3 deletions pkg/api/handlers/compat/images_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"net/http"

"github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
"github.com/pkg/errors"
Expand All @@ -16,8 +15,7 @@ func TagImage(w http.ResponseWriter, r *http.Request) {
// /v1.xx/images/(name)/tag
name := utils.GetName(r)

lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
newImage, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions)
newImage, _, err := runtime.LibimageRuntime().LookupImage(name, nil)
if err != nil {
utils.ImageNotFound(w, name, errors.Wrapf(err, "failed to find image %s", name))
return
Expand Down
4 changes: 1 addition & 3 deletions pkg/api/handlers/libpod/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"strings"

"github.com/containers/buildah"
"github.com/containers/common/libimage"
"github.com/containers/common/pkg/filters"
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/types"
Expand Down Expand Up @@ -215,8 +214,7 @@ func ExportImage(w http.ResponseWriter, r *http.Request) {
}
name := utils.GetName(r)

lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
if _, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions); err != nil {
if _, _, err := runtime.LibimageRuntime().LookupImage(name, nil); err != nil {
utils.ImageNotFound(w, name, err)
return
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/api/handlers/utils/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ func GetImages(w http.ResponseWriter, r *http.Request) ([]*libimage.Image, error

func GetImage(r *http.Request, name string) (*libimage.Image, error) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
image, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions)
image, _, err := runtime.LibimageRuntime().LookupImage(name, nil)
if err != nil {
return nil, err
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/domain/infra/abi/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func toDomainHistoryLayer(layer *libimage.ImageHistory) entities.ImageHistoryLay
}

func (ir *ImageEngine) History(ctx context.Context, nameOrID string, opts entities.ImageHistoryOptions) (*entities.ImageHistoryReport, error) {
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -245,7 +245,7 @@ func (ir *ImageEngine) Inspect(ctx context.Context, namesOrIDs []string, opts en
reports := []*entities.ImageInspectReport{}
errs := []error{}
for _, i := range namesOrIDs {
img, _, err := ir.Libpod.LibimageRuntime().LookupImage(i, &libimage.LookupImageOptions{IgnorePlatform: true})
img, _, err := ir.Libpod.LibimageRuntime().LookupImage(i, nil)
if err != nil {
// This is probably a no such image, treat as nonfatal.
errs = append(errs, err)
Expand Down Expand Up @@ -321,7 +321,7 @@ func (ir *ImageEngine) Push(ctx context.Context, source string, destination stri
}

func (ir *ImageEngine) Tag(ctx context.Context, nameOrID string, tags []string, options entities.ImageTagOptions) error {
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return err
}
Expand All @@ -334,7 +334,7 @@ func (ir *ImageEngine) Tag(ctx context.Context, nameOrID string, tags []string,
}

func (ir *ImageEngine) Untag(ctx context.Context, nameOrID string, tags []string, options entities.ImageUntagOptions) error {
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return err
}
Expand Down Expand Up @@ -454,7 +454,7 @@ func (ir *ImageEngine) Build(ctx context.Context, containerFiles []string, opts
}

func (ir *ImageEngine) Tree(ctx context.Context, nameOrID string, opts entities.ImageTreeOptions) (*entities.ImageTreeReport, error) {
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return nil, err
}
Expand Down
8 changes: 2 additions & 6 deletions pkg/domain/infra/abi/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,15 @@ func (ir *ImageEngine) ManifestCreate(ctx context.Context, names []string, image

// ManifestExists checks if a manifest list with the given name exists in local storage
func (ir *ImageEngine) ManifestExists(ctx context.Context, name string) (*entities.BoolReport, error) {
image, _, err := ir.Libpod.LibimageRuntime().LookupImage(name, &libimage.LookupImageOptions{IgnorePlatform: true})
_, err := ir.Libpod.LibimageRuntime().LookupManifestList(name)
if err != nil {
if errors.Cause(err) == storage.ErrImageUnknown {
return &entities.BoolReport{Value: false}, nil
}
return nil, err
}

isManifestList, err := image.IsManifestList(ctx)
if err != nil {
return nil, err
}
return &entities.BoolReport{Value: isManifestList}, nil
return &entities.BoolReport{Value: true}, nil
}

// ManifestInspect returns the content of a manifest list or image
Expand Down
4 changes: 1 addition & 3 deletions pkg/ps/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"strings"
"time"

"github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/domain/entities"
Expand Down Expand Up @@ -272,8 +271,7 @@ func ListStorageContainer(rt *libpod.Runtime, ctr storage.Container) (entities.L

imageName := ""
if ctr.ImageID != "" {
lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
image, _, err := rt.LibimageRuntime().LookupImage(ctr.ImageID, lookupOptions)
image, _, err := rt.LibimageRuntime().LookupImage(ctr.ImageID, nil)
if err != nil {
return ps, err
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/specgen/generate/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
var inspectData *libimage.ImageData
var err error
if s.Image != "" {
lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
newImage, _, err = r.LibimageRuntime().LookupImage(s.Image, lookupOptions)
newImage, _, err = r.LibimageRuntime().LookupImage(s.Image, nil)
if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/specgen/generate/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
options = append(options, libpod.WithRootFS(s.Rootfs))
} else {
var resolvedImageName string
lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
newImage, resolvedImageName, err = rt.LibimageRuntime().LookupImage(s.Image, lookupOptions)
newImage, resolvedImageName, err = rt.LibimageRuntime().LookupImage(s.Image, nil)
if err != nil {
return nil, err
}
Expand Down
4 changes: 4 additions & 0 deletions test/buildah-bud/apply-podman-deltas
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ skip "FIXME FIXME FIXME we'll figure these out later" \
skip "FIXME FIXME FIXME podman save/load has been fixed (but not yet used in Buildah CI)" \
"bud with --layers and --no-cache flags"

# see https://github.com/containers/podman/pull/10829
skip "FIXME FIXME FIXME - requires updated CI images (#10829)" \
"bud with --runtime and --runtime-flag"

###############################################################################
# BEGIN tests which are skipped due to actual podman bugs.

Expand Down
9 changes: 6 additions & 3 deletions vendor/github.com/containers/buildah/.cirrus.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/github.com/containers/buildah/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e1ac0c3

Please sign in to comment.