mirror of https://github.com/containers/podman.git
Bump github.com/containers/psgo from 1.4.0 to 1.5.0
Bumps [github.com/containers/psgo](https://github.com/containers/psgo) from 1.4.0 to 1.5.0. - [Release notes](https://github.com/containers/psgo/releases) - [Commits](https://github.com/containers/psgo/compare/v1.4.0...v1.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
0d2b5532c4
commit
d6d8106601
2
go.mod
2
go.mod
|
@ -13,7 +13,7 @@ require (
|
|||
github.com/containers/common v0.9.1
|
||||
github.com/containers/conmon v2.0.14+incompatible
|
||||
github.com/containers/image/v5 v5.4.3
|
||||
github.com/containers/psgo v1.4.0
|
||||
github.com/containers/psgo v1.5.0
|
||||
github.com/containers/storage v1.18.2
|
||||
github.com/coreos/go-systemd/v22 v22.0.0
|
||||
github.com/cri-o/ocicni v0.1.1-0.20190920040751-deac903fd99b
|
||||
|
|
4
go.sum
4
go.sum
|
@ -76,8 +76,8 @@ github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b h1:Q8ePgVfHDpl
|
|||
github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY=
|
||||
github.com/containers/ocicrypt v1.0.2 h1:Q0/IPs8ohfbXNxEfyJ2pFVmvJu5BhqJUAmc6ES9NKbo=
|
||||
github.com/containers/ocicrypt v1.0.2/go.mod h1:nsOhbP19flrX6rE7ieGFvBlr7modwmNjsqWarIUce4M=
|
||||
github.com/containers/psgo v1.4.0 h1:D8B4fZCCZhYgc8hDyMPCiShOinmOB1TP1qe46sSC19k=
|
||||
github.com/containers/psgo v1.4.0/go.mod h1:ENXXLQ5E1At4K0EUsGogXBJi/C28gwqkONWeLPI9fJ8=
|
||||
github.com/containers/psgo v1.5.0 h1:uofUREsrm0Ls5K4tkEIFPqWSHKyg3Bvoqo/Q2eDmj8g=
|
||||
github.com/containers/psgo v1.5.0/go.mod h1:2ubh0SsreMZjSXW1Hif58JrEcFudQyIy9EzPUWfawVU=
|
||||
github.com/containers/storage v1.18.2 h1:4cgFbrrgr9nR9xCeOmfpyxk1MtXYZGr7XGPJfAVkGmc=
|
||||
github.com/containers/storage v1.18.2/go.mod h1:WTBMf+a9ZZ/LbmEVeLHH2TX4CikWbO1Bt+/m58ZHVPg=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
## The psgo Project Community Code of Conduct
|
||||
|
||||
The psgo project follows the [Containers Community Code of Conduct](https://github.com/containers/common/blob/master/CODE-OF-CONDUCT.md).
|
|
@ -16,6 +16,8 @@ ifeq ($(shell go help mod >/dev/null 2>&1 && echo true), true)
|
|||
GO_BUILD=GO111MODULE=on $(GO) build -mod=vendor
|
||||
endif
|
||||
|
||||
GOBIN ?= $(GO)/bin
|
||||
|
||||
all: validate build
|
||||
|
||||
.PHONY: build
|
||||
|
@ -34,12 +36,7 @@ vendor:
|
|||
|
||||
.PHONY: validate
|
||||
validate: .install.lint
|
||||
@which gofmt >/dev/null 2>/dev/null || (echo "ERROR: gofmt not found." && false)
|
||||
test -z "$$(gofmt -s -l . | grep -vE 'vendor/' | tee /dev/stderr)"
|
||||
@which golangci-lint >/dev/null 2>/dev/null|| (echo "ERROR: golangci-lint not found." && false)
|
||||
test -z "$$(golangci-lint run)"
|
||||
@go doc cmd/vet >/dev/null 2>/dev/null|| (echo "ERROR: go vet not found." && false)
|
||||
test -z "$$($(GO) vet $$($(GO) list $(PROJECT)/...) 2>&1 | tee /dev/stderr)"
|
||||
$(GOBIN)/golangci-lint run
|
||||
|
||||
.PHONY: test
|
||||
test: test-unit test-integration
|
||||
|
@ -59,8 +56,7 @@ install:
|
|||
|
||||
.PHONY: .install.lint
|
||||
.install.lint:
|
||||
# Workaround for https://github.com/golangci/golangci-lint/issues/523
|
||||
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||
VERSION=1.24.0 GOBIN=$(GOBIN) sh ./hack/install_golangci.sh
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
|
|
|
@ -6,6 +6,6 @@ require (
|
|||
github.com/opencontainers/runc v0.0.0-20190425234816-dae70e8efea4
|
||||
github.com/pkg/errors v0.0.0-20190227000051-27936f6d90f9
|
||||
github.com/sirupsen/logrus v0.0.0-20190403091019-9b3cdde74fbe
|
||||
github.com/stretchr/testify v1.4.0
|
||||
github.com/stretchr/testify v1.5.1
|
||||
golang.org/x/sys v0.0.0-20190425145619-16072639606e
|
||||
)
|
||||
|
|
|
@ -16,8 +16,8 @@ github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
|||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190425145619-16072639606e h1:4ktJgTV34+N3qOZUc5fAaG3Pb11qzMm3PkAoTAgUZ2I=
|
||||
golang.org/x/sys v0.0.0-20190425145619-16072639606e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
package proc
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
@ -112,21 +113,31 @@ type Stat struct {
|
|||
}
|
||||
|
||||
// readStat is used for mocking in unit tests.
|
||||
var readStat = func(path string) ([]string, error) {
|
||||
data, err := ioutil.ReadFile(path)
|
||||
var readStat = func(path string) (string, error) {
|
||||
rawData, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return "", err
|
||||
}
|
||||
return strings.Fields(string(data)), nil
|
||||
return string(rawData), nil
|
||||
}
|
||||
|
||||
// ParseStat parses the /proc/$pid/stat file and returns a Stat.
|
||||
func ParseStat(pid string) (*Stat, error) {
|
||||
fields, err := readStat(fmt.Sprintf("/proc/%s/stat", pid))
|
||||
data, err := readStat(fmt.Sprintf("/proc/%s/stat", pid))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
firstParen := strings.IndexByte(data, '(')
|
||||
lastParen := strings.LastIndexByte(data, ')')
|
||||
if firstParen == -1 || lastParen == -1 {
|
||||
return nil, errors.New("invalid format in stat")
|
||||
}
|
||||
pidstr := data[0 : firstParen-1]
|
||||
comm := data[firstParen+1 : lastParen]
|
||||
rest := strings.Fields(data[lastParen+1:])
|
||||
fields := append([]string{pidstr, comm}, rest...)
|
||||
|
||||
fieldAt := func(i int) string {
|
||||
return fields[i-1]
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ func (p *Process) ElapsedTime() (time.Duration, error) {
|
|||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return (time.Now()).Sub(startTime), nil
|
||||
return time.Since(startTime), nil
|
||||
}
|
||||
|
||||
// StarTime returns the time.Time when process p was started.
|
||||
|
|
|
@ -305,6 +305,11 @@ var (
|
|||
onHost: true,
|
||||
procFn: processHGROUP,
|
||||
},
|
||||
{
|
||||
normal: "rss",
|
||||
header: "RSS",
|
||||
procFn: processRSS,
|
||||
},
|
||||
{
|
||||
normal: "state",
|
||||
header: "STATE",
|
||||
|
@ -663,12 +668,7 @@ func processARGS(p *process.Process, ctx *psContext) (string, error) {
|
|||
|
||||
// processCOMM returns the command name (i.e., executable name) of process p.
|
||||
func processCOMM(p *process.Process, ctx *psContext) (string, error) {
|
||||
// ps (1) returns "[$name]" if command/args are empty
|
||||
if p.CmdLine[0] == "" {
|
||||
return processName(p, ctx)
|
||||
}
|
||||
spl := strings.Split(p.CmdLine[0], "/")
|
||||
return spl[len(spl)-1], nil
|
||||
return p.Stat.Comm, nil
|
||||
}
|
||||
|
||||
// processNICE returns the nice value of process p.
|
||||
|
@ -867,6 +867,16 @@ func processHGROUP(p *process.Process, ctx *psContext) (string, error) {
|
|||
return "?", nil
|
||||
}
|
||||
|
||||
// processRSS returns the resident set size of process p in KiB (1024-byte
|
||||
// units).
|
||||
func processRSS(p *process.Process, ctx *psContext) (string, error) {
|
||||
if p.Status.VMRSS == "" {
|
||||
// probably a kernel thread
|
||||
return "0", nil
|
||||
}
|
||||
return p.Status.VMRSS, nil
|
||||
}
|
||||
|
||||
// processState returns the process state of process p.
|
||||
func processState(p *process.Process, ctx *psContext) (string, error) {
|
||||
return p.Status.State, nil
|
||||
|
|
|
@ -142,7 +142,7 @@ github.com/containers/ocicrypt/keywrap/pgp
|
|||
github.com/containers/ocicrypt/keywrap/pkcs7
|
||||
github.com/containers/ocicrypt/spec
|
||||
github.com/containers/ocicrypt/utils
|
||||
# github.com/containers/psgo v1.4.0
|
||||
# github.com/containers/psgo v1.5.0
|
||||
github.com/containers/psgo
|
||||
github.com/containers/psgo/internal/capabilities
|
||||
github.com/containers/psgo/internal/cgroups
|
||||
|
|
Loading…
Reference in New Issue