Skip to content

Commit

Permalink
Vendor in latest containers/storage and image
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Feb 6, 2024
1 parent 4e9d2d5 commit 58a9502
Show file tree
Hide file tree
Showing 722 changed files with 71,019 additions and 8,870 deletions.
8 changes: 4 additions & 4 deletions bind/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"syscall"

"github.com/containers/buildah/util"
cutil "github.com/containers/common/pkg/util"
"github.com/containers/storage/pkg/idtools"
"github.com/containers/storage/pkg/mount"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
"golang.org/x/sys/unix"
)

Expand Down Expand Up @@ -192,11 +192,11 @@ func SetupIntermediateMountNamespace(spec *specs.Spec, bundlePath string) (unmou
// Decide if the mount should not be redirected to an intermediate location first.
func leaveBindMountAlone(mount specs.Mount) bool {
// If we know we shouldn't do a redirection for this mount, skip it.
if cutil.StringInSlice(NoBindOption, mount.Options) {
if slices.Contains(mount.Options, NoBindOption) {
return true
}
// If we're not bind mounting it in, we don't need to do anything for it.
if mount.Type != "bind" && !cutil.StringInSlice("bind", mount.Options) && !cutil.StringInSlice("rbind", mount.Options) {
if mount.Type != "bind" && !slices.Contains(mount.Options, "bind") && !slices.Contains(mount.Options, "rbind") {
return true
}
return false
Expand Down Expand Up @@ -294,7 +294,7 @@ func UnmountMountpoints(mountpoint string, mountpointsToRemove []string) error {
}
}
// if we're also supposed to remove this thing, do that, too
if cutil.StringInSlice(mount.Mountpoint, mountpointsToRemove) {
if slices.Contains(mountpointsToRemove, mount.Mountpoint) {
if err := os.Remove(mount.Mountpoint); err != nil {
return fmt.Errorf("removing %q: %w", mount.Mountpoint, err)
}
Expand Down
4 changes: 2 additions & 2 deletions bind/util.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package bind

import (
"github.com/containers/common/pkg/util"
"github.com/opencontainers/runtime-spec/specs-go"
"golang.org/x/exp/slices"
)

const (
Expand All @@ -14,7 +14,7 @@ const (

func stripNoBindOption(spec *specs.Spec) {
for i := range spec.Mounts {
if util.StringInSlice(NoBindOption, spec.Mounts[i].Options) {
if slices.Contains(spec.Mounts[i].Options, NoBindOption) {
prunedOptions := make([]string, 0, len(spec.Mounts[i].Options))
for _, option := range spec.Mounts[i].Options {
if option != NoBindOption {
Expand Down
5 changes: 3 additions & 2 deletions chroot/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/opencontainers/runtime-tools/generate"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"
"golang.org/x/sys/unix"
)

Expand Down Expand Up @@ -506,13 +507,13 @@ func TestMounts(t *testing.T) {
requiredFlags = bind.options
}
for _, required := range requiredFlags {
if !util.StringInSlice(required, mount.Options) {
if !slices.Contains(mount.Options, required) {
allRequired = false
}
}
anyRejected := false
for _, rejected := range bind.reject {
if util.StringInSlice(rejected, mount.Options) {
if slices.Contains(mount.Options, rejected) {
anyRejected = true
}
}
Expand Down
10 changes: 5 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (
"github.com/containers/buildah/define"
"github.com/containers/buildah/docker"
internalUtil "github.com/containers/buildah/internal/util"
"github.com/containers/common/pkg/util"
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/pkg/compression"
"github.com/containers/image/v5/transports"
"github.com/containers/image/v5/types"
"github.com/containers/storage/pkg/stringid"
ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
)

// unmarshalConvertedConfig obtains the config blob of img valid for the wantedManifestMIMEType format
Expand Down Expand Up @@ -229,10 +229,10 @@ func (b *Builder) OSFeatures() []string {
// SetOSFeature adds a feature of the OS which the container, or a container
// built using an image built from this container, depends on the OS supplying.
func (b *Builder) SetOSFeature(feature string) {
if !util.StringInSlice(feature, b.OCIv1.OSFeatures) {
if !slices.Contains(b.OCIv1.OSFeatures, feature) {
b.OCIv1.OSFeatures = append(b.OCIv1.OSFeatures, feature)
}
if !util.StringInSlice(feature, b.Docker.OSFeatures) {
if !slices.Contains(b.Docker.OSFeatures, feature) {
b.Docker.OSFeatures = append(b.Docker.OSFeatures, feature)
}
}
Expand All @@ -241,7 +241,7 @@ func (b *Builder) SetOSFeature(feature string) {
// container built using an image built from this container, depends on the OS
// supplying.
func (b *Builder) UnsetOSFeature(feature string) {
if util.StringInSlice(feature, b.OCIv1.OSFeatures) {
if slices.Contains(b.OCIv1.OSFeatures, feature) {
features := make([]string, 0, len(b.OCIv1.OSFeatures))
for _, f := range b.OCIv1.OSFeatures {
if f != feature {
Expand All @@ -250,7 +250,7 @@ func (b *Builder) UnsetOSFeature(feature string) {
}
b.OCIv1.OSFeatures = features
}
if util.StringInSlice(feature, b.Docker.OSFeatures) {
if slices.Contains(b.Docker.OSFeatures, feature) {
features := make([]string, 0, len(b.Docker.OSFeatures))
for _, f := range b.Docker.OSFeatures {
if f != feature {
Expand Down
48 changes: 28 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ require (
github.com/containerd/containerd v1.7.13
github.com/containernetworking/cni v1.1.2
github.com/containernetworking/plugins v1.4.0
github.com/containers/common v0.57.1-0.20231130092720-630c929caef9
github.com/containers/image/v5 v5.29.1-0.20231221164234-1b221d4a9c28
github.com/containers/common v0.57.1-0.20240205153218-a7be1e2116c6
github.com/containers/image/v5 v5.29.3-0.20240205152148-dd3d3eb42d16
github.com/containers/luksy v0.0.0-20240129181507-b62d551ce6d8
github.com/containers/ocicrypt v1.1.9
github.com/containers/storage v1.51.1-0.20240102120156-ef81e9b09aad
github.com/containers/storage v1.52.1-0.20240202181245-1419a5980565
github.com/cyphar/filepath-securejoin v0.2.4
github.com/docker/distribution v2.8.3+incompatible
github.com/docker/docker v24.0.7+incompatible
github.com/docker/docker v25.0.2+incompatible
github.com/docker/go-units v0.5.0
github.com/fsouza/go-dockerclient v1.10.1
github.com/hashicorp/go-multierror v1.1.1
Expand All @@ -27,7 +27,7 @@ require (
github.com/opencontainers/runtime-spec v1.1.0
github.com/opencontainers/runtime-tools v0.9.1-0.20230914150019-408c51e934dc
github.com/opencontainers/selinux v1.11.0
github.com/openshift/imagebuilder v1.2.6-0.20240115220745-b767bc380309
github.com/openshift/imagebuilder v1.2.6
github.com/seccomp/libseccomp-golang v0.10.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
Expand All @@ -36,6 +36,7 @@ require (
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635
go.etcd.io/bbolt v1.3.8
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
golang.org/x/term v0.16.0
Expand All @@ -53,30 +54,33 @@ require (
github.com/aead/serpent v0.0.0-20160714141033-fba169763ea6 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cilium/ebpf v0.12.3 // indirect
github.com/containerd/cgroups/v3 v3.0.2 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/disiqueira/gotree/v3 v3.0.2 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 // indirect
github.com/docker/docker-credential-helpers v0.8.1 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.21.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.26.0 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/strfmt v0.21.10 // indirect
github.com/go-openapi/swag v0.22.5 // indirect
github.com/go-openapi/strfmt v0.22.0 // indirect
github.com/go-openapi/swag v0.22.9 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
Expand All @@ -94,19 +98,20 @@ require (
github.com/jinzhu/copier v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/compress v1.17.5 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/letsencrypt/boulder v0.0.0-20230907030200-6d76a0f91e1e // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-sqlite3 v1.14.19 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mistifyio/go-zfs/v3 v3.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand All @@ -120,26 +125,29 @@ require (
github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect
github.com/sigstore/fulcio v1.4.3 // indirect
github.com/sigstore/rekor v1.2.2 // indirect
github.com/sigstore/sigstore v1.8.0 // indirect
github.com/sigstore/sigstore v1.8.1 // indirect
github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 // indirect
github.com/sylabs/sif/v2 v2.15.1 // indirect
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vbauerster/mpb/v8 v8.7.1 // indirect
github.com/vbauerster/mpb/v8 v8.7.2 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
go.mongodb.org/mongo-driver v1.13.1 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/grpc v1.59.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/grpc v1.61.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 58a9502

Please sign in to comment.