Skip to content

Commit

Permalink
fixup error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sharanyad committed Oct 16, 2017
1 parent e69700b commit 60357cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions agent/engine/dockerclient/dockerclientfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,20 @@ func getDockerClientForVersion(
moreThanMaxCheck := ">" + apiVersion + zeroPatch
minVersionCheck, err := utils.Version(version).Matches(lessThanMinCheck)
if err != nil {
return nil, errors.Wrapf(err, "error while comparing version %s with minAPIVersion %s", version, minAPIVersion)
return nil, errors.Wrapf(err, "version detection using MinAPIVersion: unable to get min version: %s", minAPIVersion)
}
maxVersionCheck, err := utils.Version(version).Matches(moreThanMaxCheck)
if err != nil {
return nil, errors.Wrapf(err, "error while comparing version %s with apiVersion %s", version, apiVersion)
return nil, errors.Wrapf(err, "version detection using MinAPIVersion: unable to get max version: %s", apiVersion)
}
// do not add the version when it is less than min api version or greater
// than api version
if minVersionCheck || maxVersionCheck {
return nil, errors.Errorf("min and API versions comparison check failed for version: %s", version)
return nil, errors.Errorf("version detection using MinAPIVersion: unsupported version: %s", version)
}
client, err := newVersionedClient(endpoint, string(version))
if err != nil {
return nil, errors.Wrapf(err, "unable to create Docker client for version: %s", version)
return nil, errors.Wrapf(err, "version detection using MinAPIVersion: unable to create Docker client for version: %s", version)
}
return client, nil
}

0 comments on commit 60357cc

Please sign in to comment.