Merge pull request #33887 from thaJeztah/update-version-error

Fix NewVersionError() for clients using default version
This commit is contained in:
Victor Vieux 2017-07-12 15:24:00 +02:00 committed by GitHub
commit 45cad73ea8
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ func IsErrPluginPermissionDenied(err error) bool {
// NewVersionError returns an error if the APIVersion required
// if less than the current supported version
func (cli *Client) NewVersionError(APIrequired, feature string) error {
if versions.LessThan(cli.version, APIrequired) {
if cli.version != "" && versions.LessThan(cli.version, APIrequired) {
return fmt.Errorf("%q requires API version %s, but the Docker daemon API version is %s", feature, APIrequired, cli.version)
}
return nil