Skip to content

Commit aa07e6c

Browse files
chuongld20claude
andcommitted
fix: validate server after resolution, not before (ISS-43 review)
Move cfg.Server = targetServer before ValidateForUp() so validation checks the resolved value instead of the stale YAML value. Prevents subtle bugs if ValidateForUp is extended to check additional fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a5784b4 commit aa07e6c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

cmd/devbox/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,10 @@ func upCmd(wm workspace.Manager) *cobra.Command {
169169
}
170170
// Tier 2: config.Server is already set in targetServer.
171171

172+
cfg.Server = targetServer
172173
if err := cfg.ValidateForUp(poolConfigured); err != nil {
173-
if targetServer == "" {
174-
return fmt.Errorf("devbox up: %w", err)
175-
}
174+
return fmt.Errorf("devbox up: %w", err)
176175
}
177-
cfg.Server = targetServer
178176

179177
// Merge resource limits: server defaults <- workspace overrides.
180178
globalCfg, err := config.LoadGlobal()

0 commit comments

Comments
 (0)