Skip to content

Commit

Permalink
#2239: Fix bug causing some docker engine versions on linux to incorr…
Browse files Browse the repository at this point in the history
…ectly throw an incompatibility warning
  • Loading branch information
smutlord committed May 12, 2020
1 parent 56c27d5 commit 67cf562
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/help/2020-changelog.md
Expand Up @@ -8,7 +8,7 @@ Edge releases contain the newest bug fixes and features and *may* be less stable

Otherwise, scroll down and use the first release that has the green `Latest Release` tag. For more information about the Lando release cycle check out [this](https://docs.lando.dev/config/releases.html).

* Fixed regression in `build` and `event` quote passthrough logic causing other commands to not parse correctly [#1926](https://github.com/lando/lando/pull/1926)
* Fixed bug causing some Docker Engine versions on Linux to incorrectly throw an incompatibility warning [#2239](https://github.com/lando/lando/pull/2239)

Lando is **free** and **open source** software that relies on contributions from developers like you! If you like Lando then help us spend more time making, updating and supporting it by [contributing](https://github.com/sponsors/lando).

Expand Down
7 changes: 4 additions & 3 deletions lib/engine.js
Expand Up @@ -163,12 +163,13 @@ module.exports = class Engine {
};

/*
*
* @TODO: Need to docblock this correctly so it shows up in the API docs
*/
getCompatibility(supportedVersions = this.supportedVersions) {
const semver = require('semver');
return this.daemon.getVersions().then(versions => {
// Remove the things we dont need depending on platform
// @TODO: Should daemon.getVersions just do this automatically?
if (process.platform === 'linux') delete versions.desktop;
else {
delete versions.compose;
Expand All @@ -183,10 +184,10 @@ module.exports = class Engine {
parts[2] = `${parts[2]}${parts.pop()}`;
version = parts.join('.');
}
return semver.clean(version, true);
return semver.valid(semver.coerce(version, true));
};

// Socker doesnt use strict semver for the engine and compose strings so we coerce a bit
// Docker doesnt use strict semver for the engine and compose strings so we coerce a bit
return _(versions)
// Do a first map pass to parse
.map((version, thing) => ({
Expand Down
1 change: 0 additions & 1 deletion lib/utils.js
Expand Up @@ -11,7 +11,6 @@ const path = require('path');
const Yaml = require('./yaml');
const yaml = new Yaml();


/*
* Helper to get app mounts
*/
Expand Down

0 comments on commit 67cf562

Please sign in to comment.