diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-04 09:46:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-04 09:46:24 -0500 |
commit | 87a78c059dc2fb72ba54805d5488f3e619ae46f1 (patch) | |
tree | a6c7ca6a504f71b1af2307fcdfbbae6787d73b6b /pkg/bindings/connection.go | |
parent | 17cacea3fa2bf0df20572720b9a0a3be35f2ef7b (diff) | |
parent | f86d64130838fbeb75ea2776a2f2b6c4a49e58b3 (diff) | |
download | podman-87a78c059dc2fb72ba54805d5488f3e619ae46f1.tar.gz podman-87a78c059dc2fb72ba54805d5488f3e619ae46f1.tar.bz2 podman-87a78c059dc2fb72ba54805d5488f3e619ae46f1.zip |
Merge pull request #9601 from jwhonce/issues/9207
Use version package to track all versions
Diffstat (limited to 'pkg/bindings/connection.go')
-rw-r--r-- | pkg/bindings/connection.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index ad16498d5..21a8e7a8b 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -14,6 +14,7 @@ import ( "github.com/blang/semver" "github.com/containers/podman/v3/pkg/terminal" + "github.com/containers/podman/v3/version" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -25,7 +26,7 @@ var ( BasePath = &url.URL{ Scheme: "http", Host: "d", - Path: "/v" + APIVersion.String() + "/libpod", + Path: "/v" + version.APIVersion[version.Libpod][version.CurrentAPI].String() + "/libpod", } ) @@ -168,15 +169,16 @@ func pingNewConnection(ctx context.Context) error { return err } - switch APIVersion.Compare(versionSrv) { + switch version.APIVersion[version.Libpod][version.MinimalAPI].Compare(versionSrv) { case -1, 0: // Server's job when Client version is equal or older return nil case 1: - return errors.Errorf("server API version is too old. Client %q server %q", APIVersion.String(), versionSrv.String()) + return errors.Errorf("server API version is too old. Client %q server %q", + version.APIVersion[version.Libpod][version.MinimalAPI].String(), versionSrv.String()) } } - return errors.Errorf("ping response was %q", response.StatusCode) + return errors.Errorf("ping response was %d", response.StatusCode) } func sshClient(_url *url.URL, secure bool, passPhrase string, identity string) (Connection, error) { |