Skip to content

Save -o options of provider add/update with --use=false - #26

Merged
renatoathaydes merged 1 commit into
mainfrom
fix/provider-add-use-false-options
Oct 20, 2026
Merged

renatoathaydes merged 1 commit into
mainfrom
fix/provider-add-use-false-options

Conversation

@renatoathaydes

Copy link
Copy Markdown
Collaborator

Problem

devpod provider add <source> --use=false -o KEY=VALUE reported success but saved none of the options: only --use=true called ConfigureProvider, so config.yaml got just a creationTimestamp for the provider. The same happened to the options --from-existing copies from the template provider, and to devpod provider update --use=false -o .... Inherited from upstream.

Fix

  • ConfigureProvider takes a new setDefault flag; it only changes the default provider when that's true.
  • provider add and provider update with --use=false still configure the provider (resolve options, run init, save) when there's something to save (-o, options from --from-existing, or --single-machine for add), but leave the default provider unchanged.
  • Without options they skip configuration as before, so a provider that needs required options can still be added and configured later. The desktop app always calls add/update with --use=false and without -o, so it isn't affected.

Testing

  • New cmd/provider/add_test.go covers --use=false + -o, --from-existing + --use=false, and --use=false without options, using a temporary DEVPOD_HOME. The first test fails without the fix.
  • Manual check with a temporary DEVPOD_HOME: provider add docker --name aks --use=false -o DOCKER_PATH=/x, then provider update aks docker --use=false -o INACTIVITY_TIMEOUT=5m. Both options are saved, the provider is initialized, and no default provider is set.
  • go build ./..., go vet ./..., go test ./cmd/... ./pkg/... pass.

🤖 Generated with Claude Code

`devpod provider add --use=false -o KEY=VALUE` (and `provider update`)
only configured the provider when --use was true, so the options were
silently dropped. The same applied to the options --from-existing copies
from the template provider.

ConfigureProvider now takes a setDefault flag. Without --use, add and
update still configure the provider when there are options to save, but
leave the default provider unchanged. Without options, they skip
configuration as before, so a provider with required options can still
be added and configured later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@renatoathaydes
renatoathaydes merged commit d42aaeb into main Oct 20, 2026
17 checks passed
@renatoathaydes
renatoathaydes deleted the fix/provider-add-use-false-options branch October 20, 2026 12:36
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