vendor: containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c
full diff: a5c2862aed...7016d3ce23
- add go.mod
- Parse runc version even if commit is missing
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
d9d1d5b624
commit
f09e999099
@ -6,7 +6,7 @@ github.com/containerd/cgroups b4448137398923af7f4918b8b2ad
|
|||||||
github.com/containerd/console v1.0.0
|
github.com/containerd/console v1.0.0
|
||||||
github.com/containerd/continuity d3ef23f19fbb106bb73ffde425d07a9187e30745
|
github.com/containerd/continuity d3ef23f19fbb106bb73ffde425d07a9187e30745
|
||||||
github.com/containerd/fifo f15a3290365b9d2627d189e619ab4008e0069caf
|
github.com/containerd/fifo f15a3290365b9d2627d189e619ab4008e0069caf
|
||||||
github.com/containerd/go-runc a5c2862aed5e6358b305b0e16bfce58e0549b1cd
|
github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c
|
||||||
github.com/containerd/ttrpc v1.0.1
|
github.com/containerd/ttrpc v1.0.1
|
||||||
github.com/containerd/typeurl v1.0.1
|
github.com/containerd/typeurl v1.0.1
|
||||||
github.com/coreos/go-systemd/v22 v22.0.0
|
github.com/coreos/go-systemd/v22 v22.0.0
|
||||||
|
10
vendor/github.com/containerd/go-runc/go.mod
generated
vendored
Normal file
10
vendor/github.com/containerd/go-runc/go.mod
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module github.com/containerd/go-runc
|
||||||
|
|
||||||
|
go 1.13
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e
|
||||||
|
github.com/opencontainers/runtime-spec v1.0.1
|
||||||
|
github.com/pkg/errors v0.8.1
|
||||||
|
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449
|
||||||
|
)
|
38
vendor/github.com/containerd/go-runc/runc.go
generated
vendored
38
vendor/github.com/containerd/go-runc/runc.go
generated
vendored
@ -623,32 +623,22 @@ func (r *Runc) Version(context context.Context) (Version, error) {
|
|||||||
func parseVersion(data []byte) (Version, error) {
|
func parseVersion(data []byte) (Version, error) {
|
||||||
var v Version
|
var v Version
|
||||||
parts := strings.Split(strings.TrimSpace(string(data)), "\n")
|
parts := strings.Split(strings.TrimSpace(string(data)), "\n")
|
||||||
if len(parts) != 3 {
|
|
||||||
return v, nil
|
if len(parts) > 0 {
|
||||||
}
|
if !strings.HasPrefix(parts[0], "runc version ") {
|
||||||
for i, p := range []struct {
|
return v, nil
|
||||||
dest *string
|
}
|
||||||
split string
|
v.Runc = parts[0][13:]
|
||||||
}{
|
|
||||||
{
|
for _, part := range parts[1:] {
|
||||||
dest: &v.Runc,
|
if strings.HasPrefix(part, "commit: ") {
|
||||||
split: "version ",
|
v.Commit = part[8:]
|
||||||
},
|
} else if strings.HasPrefix(part, "spec: ") {
|
||||||
{
|
v.Spec = part[6:]
|
||||||
dest: &v.Commit,
|
}
|
||||||
split: ": ",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
dest: &v.Spec,
|
|
||||||
split: ": ",
|
|
||||||
},
|
|
||||||
} {
|
|
||||||
p2 := strings.Split(parts[i], p.split)
|
|
||||||
if len(p2) != 2 {
|
|
||||||
return v, fmt.Errorf("unable to parse version line %q", parts[i])
|
|
||||||
}
|
}
|
||||||
*p.dest = p2[1]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user