Move to new github.com/sirupsen/logrus.

Need to mv to latest released and supported version of logrus
switch github.com/Sirupsen/logrus github.com/sirupsen/logrus

Also vendor in latest containers/storage and containers/image

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2017-08-05 07:40:46 -04:00
parent 816b15e07e
commit 63a218a458
366 changed files with 7104 additions and 2749 deletions

View file

@ -14,9 +14,9 @@ import (
"unicode"
"unicode/utf8"
"github.com/Sirupsen/logrus"
"github.com/blang/semver"
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
"github.com/syndtr/gocapability/capability"
)
@ -96,22 +96,31 @@ func NewValidatorFromPath(bundlePath string, hostSpecific bool, platform string)
// CheckAll checks all parts of runtime bundle
func (v *Validator) CheckAll() (msgs []string) {
msgs = append(msgs, v.CheckPlatform()...)
msgs = append(msgs, v.CheckRootfsPath()...)
msgs = append(msgs, v.CheckRoot()...)
msgs = append(msgs, v.CheckMandatoryFields()...)
msgs = append(msgs, v.CheckSemVer()...)
msgs = append(msgs, v.CheckMounts()...)
msgs = append(msgs, v.CheckProcess()...)
msgs = append(msgs, v.CheckHooks()...)
if v.spec.Linux != nil {
msgs = append(msgs, v.CheckLinux()...)
}
msgs = append(msgs, v.CheckLinux()...)
return
}
// CheckRootfsPath checks status of v.spec.Root.Path
func (v *Validator) CheckRootfsPath() (msgs []string) {
logrus.Debugf("check rootfs path")
// CheckRoot checks status of v.spec.Root
func (v *Validator) CheckRoot() (msgs []string) {
logrus.Debugf("check root")
if v.platform == "windows" && v.spec.Windows.HyperV != nil {
if v.spec.Root != nil {
msgs = append(msgs, fmt.Sprintf("for Hyper-V containers, Root must not be set"))
return
}
return
} else if v.spec.Root == nil {
msgs = append(msgs, fmt.Sprintf("for non-Hyper-V containers, Root must be set"))
return
}
absBundlePath, err := filepath.Abs(v.bundlePath)
if err != nil {
@ -211,6 +220,10 @@ func checkEventHooks(hookType string, hooks []rspec.Hook, hostSpecific bool) (ms
func (v *Validator) CheckProcess() (msgs []string) {
logrus.Debugf("check process")
if v.spec.Process == nil {
return
}
process := v.spec.Process
if !filepath.IsAbs(process.Cwd) {
msgs = append(msgs, fmt.Sprintf("cwd %q is not an absolute path", process.Cwd))
@ -425,6 +438,10 @@ func (v *Validator) CheckPlatform() (msgs []string) {
func (v *Validator) CheckLinux() (msgs []string) {
logrus.Debugf("check linux")
if v.spec.Linux == nil {
return
}
var typeList = map[rspec.LinuxNamespaceType]struct {
num int
newExist bool