Skip to content

fix(multipass): use key=value format for multipass set commands - #58

Merged
laolusrael merged 1 commit into
developfrom
fix/multipass-set-keyvalue
Apr 23, 2026
Merged

fix(multipass): use key=value format for multipass set commands#58
laolusrael merged 1 commit into
developfrom
fix/multipass-set-keyvalue

Conversation

@laolusrael

Copy link
Copy Markdown
Owner

Summary

Fixes PUT /api/instances/{name}/resources and all other multipass set calls failing because key and value were passed as separate arguments instead of key=value.

Root Cause

Multipass set command requires key=value as a single argument:

# Wrong (what we were doing)
multipass set local.claw.memory 4.0G

# Correct
multipass set local.claw.memory=4.0G

This caused the error:

Need exactly one key-value pair (in <key>=<value> form).

Changes

  1. Fix SetInstanceResources — CPU, memory, and disk now use key=value format
  2. Fix snapshot comment setter — also changed to key=value format
  3. Accept decimal valuesparseMemoryString uses ParseFloat to handle "4.0G"
  4. Capture stderrCombinedOutput() surfaces real multipass error messages
  5. Skip unchanged values — only calls multipass set for values that actually changed
  6. Update docs — corrected multipass set syntax in API reference

Files Changed

  • api/internal/multipass/client.go
  • docs/MULTIPASS_API_REFERENCE.md

Test Results

  • go test -tags ci ./... — Pass

@laolusrael
laolusrael force-pushed the fix/multipass-set-keyvalue branch from 8debb4c to f2b485f Compare April 23, 2026 12:43
@laolusrael
laolusrael merged commit c4ff749 into develop Apr 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant