Skip to content

Commit

Permalink
Merge pull request #20058 from rhatdan/VENDOR
Browse files Browse the repository at this point in the history
vendor of containers/common
  • Loading branch information
openshift-merge-robot authored Sep 20, 2023
2 parents 370937d + 73dc72f commit 93623fe
Show file tree
Hide file tree
Showing 24 changed files with 257 additions and 230 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.1-0.20230919073449-d1d9d38d8282
github.com/containers/common v0.56.1-0.20230920110729-eb4ad859f309
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/gvisor-tap-vsock v0.7.1-0.20230907154503-507f56851e8b
github.com/containers/image/v5 v5.28.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.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/common v0.56.1-0.20230920110729-eb4ad859f309 h1:ZuP6m9Ps9bBR/3TlR4AqzobAvtYstKkoYmKIg3R7O84=
github.com/containers/common v0.56.1-0.20230920110729-eb4ad859f309/go.mod h1:ABFEglmyt48WWWQv80kGhitfbVfR1Br35wk3gBQdrIk=
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/gvisor-tap-vsock v0.7.1-0.20230907154503-507f56851e8b h1:1nH+VNnclNbAXwcsK2MkLT3gFWfbxasQOPBkj1DUmCI=
Expand Down
4 changes: 2 additions & 2 deletions libpod/define/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/util"
"github.com/containers/common/pkg/detach"
)

var (
Expand Down Expand Up @@ -93,7 +93,7 @@ var (

// ErrDetach indicates that an attach session was manually detached by
// the user.
ErrDetach = util.ErrDetach
ErrDetach = detach.ErrDetach

// ErrWillDeadlock indicates that the requested operation will cause a
// deadlock. This is usually caused by upgrade issues, and is resolved
Expand Down
8 changes: 4 additions & 4 deletions libpod/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/containers/buildah"
"github.com/containers/buildah/pkg/util"
cutil "github.com/containers/common/pkg/util"
"github.com/containers/common/pkg/version"
"github.com/containers/image/v5/pkg/sysregistriesv2"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/libpod/linkmode"
Expand Down Expand Up @@ -243,14 +243,14 @@ func (r *Runtime) storeInfo() (*define.StoreInfo, error) {
for _, o := range r.store.GraphOptions() {
split := strings.SplitN(o, "=", 2)
if strings.HasSuffix(split[0], "mount_program") {
version, err := cutil.ProgramVersion(split[1])
ver, err := version.Program(split[1])
if err != nil {
logrus.Warnf("Failed to retrieve program version for %s: %v", split[1], err)
}
program := map[string]interface{}{}
program["Executable"] = split[1]
program["Version"] = version
program["Package"] = cutil.PackageVersion(split[1])
program["Version"] = ver
program["Package"] = version.Package(split[1])
graphOptions[split[0]] = program
} else {
graphOptions[split[0]] = split[1]
Expand Down
14 changes: 7 additions & 7 deletions libpod/info_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/containers/common/pkg/apparmor"
"github.com/containers/common/pkg/cgroups"
"github.com/containers/common/pkg/seccomp"
"github.com/containers/common/pkg/util"
"github.com/containers/common/pkg/version"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/rootless"
"github.com/opencontainers/selinux/go-selinux"
Expand Down Expand Up @@ -62,28 +62,28 @@ func (r *Runtime) setPlatformHostInfo(info *define.HostInfo) error {
slirp4netnsPath, _ = r.config.FindHelperBinary(libpod.BinaryName, true)
}
if slirp4netnsPath != "" {
version, err := util.ProgramVersion(slirp4netnsPath)
ver, err := version.Program(slirp4netnsPath)
if err != nil {
logrus.Warnf("Failed to retrieve program version for %s: %v", slirp4netnsPath, err)
}
program := define.SlirpInfo{
Executable: slirp4netnsPath,
Package: util.PackageVersion(slirp4netnsPath),
Version: version,
Package: version.Package(slirp4netnsPath),
Version: ver,
}
info.Slirp4NetNS = program
}

pastaPath, _ := r.config.FindHelperBinary(pasta.BinaryName, true)
if pastaPath != "" {
version, err := util.ProgramVersion(pastaPath)
ver, err := version.Program(pastaPath)
if err != nil {
logrus.Warnf("Failed to retrieve program version for %s: %v", pastaPath, err)
}
program := define.PastaInfo{
Executable: pastaPath,
Package: util.PackageVersion(pastaPath),
Version: version,
Package: version.Package(pastaPath),
Version: ver,
}
info.Pasta = program
}
Expand Down
4 changes: 2 additions & 2 deletions libpod/oci_conmon_attach_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"syscall"

"github.com/containers/common/pkg/config"
"github.com/containers/common/pkg/detach"
"github.com/containers/common/pkg/resize"
"github.com/containers/common/pkg/util"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/errorhandling"
"github.com/moby/term"
Expand Down Expand Up @@ -235,7 +235,7 @@ func setupStdioChannels(streams *define.AttachStreams, conn *net.UnixConn, detac
go func() {
var err error
if streams.AttachInput {
_, err = util.CopyDetachable(conn, streams.InputStream, detachKeys)
_, err = detach.Copy(conn, streams.InputStream, detachKeys)
}
stdinDone <- err
}()
Expand Down
11 changes: 6 additions & 5 deletions libpod/oci_conmon_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import (
"time"

"github.com/containers/common/pkg/config"
"github.com/containers/common/pkg/detach"
"github.com/containers/common/pkg/resize"
cutil "github.com/containers/common/pkg/util"
"github.com/containers/common/pkg/version"
conmonConfig "github.com/containers/conmon/runner/config"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/libpod/logs"
Expand Down Expand Up @@ -583,7 +584,7 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http.
if detachKeys != nil {
detachString = *detachKeys
}
detach, err := processDetachKeys(detachString)
isDetach, err := processDetachKeys(detachString)
if err != nil {
return err
}
Expand Down Expand Up @@ -735,7 +736,7 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http.
// Next, STDIN. Avoid entirely if attachStdin unset.
if attachStdin {
go func() {
_, err := cutil.CopyDetachable(conn, httpBuf, detach)
_, err := detach.Copy(conn, httpBuf, isDetach)
logrus.Debugf("STDIN copy completed")
stdinChan <- err
}()
Expand Down Expand Up @@ -943,8 +944,8 @@ func (r *ConmonOCIRuntime) ExitFilePath(ctr *Container) (string, error) {

// RuntimeInfo provides information on the runtime.
func (r *ConmonOCIRuntime) RuntimeInfo() (*define.ConmonInfo, *define.OCIRuntimeInfo, error) {
runtimePackage := cutil.PackageVersion(r.path)
conmonPackage := cutil.PackageVersion(r.conmonPath)
runtimePackage := version.Package(r.path)
conmonPackage := version.Package(r.conmonPath)
runtimeVersion, err := r.getOCIRuntimeVersion()
if err != nil {
return nil, nil, fmt.Errorf("getting version of OCI runtime %s: %w", r.name, err)
Expand Down
4 changes: 2 additions & 2 deletions libpod/oci_conmon_exec_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"time"

"github.com/containers/common/pkg/config"
"github.com/containers/common/pkg/detach"
"github.com/containers/common/pkg/resize"
cutil "github.com/containers/common/pkg/util"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/errorhandling"
"github.com/containers/podman/v4/pkg/lookup"
Expand Down Expand Up @@ -606,7 +606,7 @@ func attachExecHTTP(c *Container, sessionID string, r *http.Request, w http.Resp
if attachStdin {
go func() {
logrus.Debugf("Beginning STDIN copy")
_, err := cutil.CopyDetachable(conn, httpBuf, detachKeys)
_, err := detach.Copy(conn, httpBuf, detachKeys)
logrus.Debugf("STDIN copy completed")
stdinChan <- err
}()
Expand Down
8 changes: 4 additions & 4 deletions pkg/bindings/containers/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"strconv"
"time"

"github.com/containers/common/pkg/util"
"github.com/containers/common/pkg/detach"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/pkg/bindings"
"github.com/moby/term"
Expand Down Expand Up @@ -159,7 +159,7 @@ func Attach(ctx context.Context, nameOrID string, stdin io.Reader, stdout io.Wri
go func() {
logrus.Debugf("Copying STDIN to socket")

_, err := util.CopyDetachable(socket, stdin, detachKeysInBytes)
_, err := detach.Copy(socket, stdin, detachKeysInBytes)
if err != nil && err != define.ErrDetach {
logrus.Errorf("Failed to write input to service: %v", err)
}
Expand Down Expand Up @@ -497,7 +497,7 @@ func ExecStartAndAttach(ctx context.Context, sessionID string, options *ExecStar
if options.GetAttachInput() {
go func() {
logrus.Debugf("Copying STDIN to socket")
_, err := util.CopyDetachable(socket, options.InputStream, []byte{})
_, err := detach.Copy(socket, options.InputStream, []byte{})
if err != nil {
logrus.Errorf("Failed to write input to service: %v", err)
}
Expand All @@ -518,7 +518,7 @@ func ExecStartAndAttach(ctx context.Context, sessionID string, options *ExecStar
return fmt.Errorf("exec session %s has a terminal and must have STDOUT enabled", sessionID)
}
// If not multiplex'ed, read from server and write to stdout
_, err := util.CopyDetachable(options.GetOutputStream(), socket, []byte{})
_, err := detach.Copy(options.GetOutputStream(), socket, []byte{})
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/filters/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func GenerateContainerFilterFuncs(filter string, filterValues []string, r *libpo
switch filter {
case "id":
return func(c *libpod.Container) bool {
return util.FilterID(c.ID(), filterValues)
return filters.FilterID(c.ID(), filterValues)
}, nil
case "label":
// we have to match that all given labels exits on that container
Expand Down
4 changes: 2 additions & 2 deletions pkg/domain/filters/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func GeneratePodFilterFunc(filter string, filterValues []string, r *libpod.Runti
return false
}
for _, id := range ctrIds {
if util.FilterID(id, filterValues) {
if filters.FilterID(id, filterValues) {
return true
}
}
Expand Down Expand Up @@ -90,7 +90,7 @@ func GeneratePodFilterFunc(filter string, filterValues []string, r *libpod.Runti
}, nil
case "id":
return func(p *libpod.Pod) bool {
return util.FilterID(p.ID(), filterValues)
return filters.FilterID(p.ID(), filterValues)
}, nil
case "name":
return func(p *libpod.Pod) bool {
Expand Down
10 changes: 5 additions & 5 deletions vendor/github.com/containers/common/libnetwork/cni/network.go

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

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

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

4 changes: 2 additions & 2 deletions vendor/github.com/containers/common/pkg/auth/auth.go

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

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

21 changes: 21 additions & 0 deletions vendor/github.com/containers/common/pkg/filters/filters.go

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

Loading

0 comments on commit 93623fe

Please sign in to comment.