diff options
author | Peter Hunt <pehunt@redhat.com> | 2019-08-12 10:59:45 -0400 |
---|---|---|
committer | Peter Hunt <pehunt@redhat.com> | 2019-10-28 16:13:58 -0400 |
commit | 57fa6cf756219baa1d8d562906ccf5bbb85380dc (patch) | |
tree | e3af332c8e645078bd969655c01523fb87deb76e | |
parent | f0da9cfc26158098c2f63dbba7fe33fd4af800aa (diff) | |
download | podman-57fa6cf756219baa1d8d562906ccf5bbb85380dc.tar.gz podman-57fa6cf756219baa1d8d562906ccf5bbb85380dc.tar.bz2 podman-57fa6cf756219baa1d8d562906ccf5bbb85380dc.zip |
require conmon v2.0.0
Signed-off-by: Peter Hunt <pehunt@redhat.com>
-rw-r--r-- | libpod/runtime.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 107e8e3d0..64e645299 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -84,6 +84,9 @@ var ( // DefaultDetachKeys is the default keys sequence for detaching a // container DefaultDetachKeys = "ctrl-p,ctrl-q" + + // minConmonMajor is the major version required for conmon + minConmonMajor = 2 ) // A RuntimeOption is a functional option which alters the Runtime created by @@ -783,6 +786,7 @@ func getLockManager(runtime *Runtime) (lock.Manager, error) { // probeConmon calls conmon --version and verifies it is a new enough version for // the runtime expectations podman currently has func probeConmon(conmonBinary string) error { + versionFormatErr := "conmon version changed format" cmd := exec.Command(conmonBinary, "--version") var out bytes.Buffer cmd.Stdout = &out @@ -794,17 +798,13 @@ func probeConmon(conmonBinary string) error { matches := r.FindStringSubmatch(out.String()) if len(matches) != 4 { - return errors.Wrapf(err, "conmon version changed format") + return errors.Wrapf(err, versionFormatErr) } major, err := strconv.Atoi(matches[1]) - if err != nil || major < 1 { - return define.ErrConmonOutdated + if err != nil { + return errors.Wrapf(err, versionFormatErr) } - // conmon used to be shipped with CRI-O, and was versioned along with it. - // even though the conmon that came with crio-1.9 to crio-1.15 has a higher - // version number than conmon 1.0.0, 1.0.0 is newer, so we need this check - minor, err := strconv.Atoi(matches[2]) - if err != nil || minor > 9 { + if major < minConmonMajor { return define.ErrConmonOutdated } @@ -866,7 +866,7 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) { if !foundConmon { if foundOutdatedConmon { - return errors.Wrapf(define.ErrConmonOutdated, "please update to v1.0.0 or later") + return errors.Wrapf(define.ErrConmonOutdated, "please update to v%d.0.0 or later", minConmonMajor) } return errors.Wrapf(define.ErrInvalidArg, "could not find a working conmon binary (configured options: %v)", |