Repository navigation
Save -o options of provider add/update with --use=false - #26
Merged
Merged
Conversation
`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>
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.
Problem
devpod provider add <source> --use=false -o KEY=VALUEreported success but saved none of the options: only--use=truecalledConfigureProvider, soconfig.yamlgot just acreationTimestampfor the provider. The same happened to the options--from-existingcopies from the template provider, and todevpod provider update --use=false -o .... Inherited from upstream.Fix
ConfigureProvidertakes a newsetDefaultflag; it only changes the default provider when that's true.provider addandprovider updatewith--use=falsestill configure the provider (resolve options, run init, save) when there's something to save (-o, options from--from-existing, or--single-machineforadd), but leave the default provider unchanged.add/updatewith--use=falseand without-o, so it isn't affected.Testing
cmd/provider/add_test.gocovers--use=false+-o,--from-existing+--use=false, and--use=falsewithout options, using a temporaryDEVPOD_HOME. The first test fails without the fix.DEVPOD_HOME:provider add docker --name aks --use=false -o DOCKER_PATH=/x, thenprovider 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