Repository navigation
fix(daemon): report skip instead of null when Docker.app is missing - #508
Draft
jordan8037310 wants to merge 1 commit into
Draft
jordan8037310 wants to merge 1 commit into
jordan8037310 wants to merge 1 commit into
Conversation
On macOS without /Applications/Docker.app (e.g. OrbStack or Colima only), getVersions() returned desktop: null and is-compatible-version threw "Cannot read properties of null (reading 'trim')". Report 'skip', as the win32 branch already does, guard the semver check in up(), and treat an unparseable version as incompatible instead of throwing. Fixes lando#138 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
👷 Deploy request for lando-core pending review.Visit the deploys page to approve it
|
Contributor
Privileged Leia tests skippedThe After reviewing gh workflow run pr-core-tests.yml --repo lando/core -f pull_request=508 -f commit_sha=b12ed84aa0235323c03a9a39db7e16b33d7c0ff5or from the workflow page using the same inputs. This comment updates when new commits are pushed and the dispatch only accepts the current head commit. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #138.
On macOS,
landocrashes withCannot read properties of null (reading 'trim')when/Applications/Docker.appis missing, for example on OrbStack or Colima without Docker Desktop installed.Cause
daemon.getVersions()reads the version fromDocker.app/Contents/Info.plist. When the file is missing it returnsdesktop: null.utils/is-compatible-version.jsthen callssemver.clean(null), which throws.daemon.up()also callssemver.gte(null, …), so Lando cannot autostart the engine either.Change
getVersions()returnsdesktop: 'skip'when the plist cannot be read. This is the convention the win32/WSL branch already uses whencomponentsVersion.jsonis missing, andengine.getCompatibility()already dropsskipentries.up()only takes thedocker desktop startpath when the version is valid semver. Otherwise it falls back toopen /Applications/Docker.appas before.is-compatible-versionreturnsfalsefor a null or unparseable version instead of throwing.No behavior change when Docker Desktop is installed.
Validation
test/is-compatible-version.spec.jscovers in-range, out-of-range, andnull/undefined/'skip'.#getVersionscases intest/daemon.spec.js: the plist read fails →skip, and the plist returns4.85.0→4.85.0.mainand passes with the change.npm teston Node 20: lint clean, all unit specs pass.lando startno longer throws, and no Docker Desktop version warning is shown.🤖 Generated with Claude Code