summaryrefslogtreecommitdiffstats
path: root/client/go/internal
diff options
context:
space:
mode:
authorEirik Nygaard <eirik@vespa.ai>2023-11-10 08:58:32 +0100
committerGitHub <noreply@github.com>2023-11-10 08:58:32 +0100
commit83b1ccd36dd5df2e43307aab19adc07b41c94c9f (patch)
tree9d881d9d8e187b33f84c853b64389acfab659397 /client/go/internal
parente44e70aa1050ad8a035bd371940534021ecad504 (diff)
parentba1e176d64981cfd39f03ba72e2545a6833045d0 (diff)
Merge pull request #29281 from vespa-engine/ean/validate-deploy-init-input
Require a minimum amount of nodes when creating deployment.xml
Diffstat (limited to 'client/go/internal')
-rw-r--r--client/go/internal/cli/cmd/prod.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/go/internal/cli/cmd/prod.go b/client/go/internal/cli/cmd/prod.go
index 3ff46768e0c..496d1f27e3b 100644
--- a/client/go/internal/cli/cmd/prod.go
+++ b/client/go/internal/cli/cmd/prod.go
@@ -313,7 +313,10 @@ func promptNodeCount(cli *CLI, stdin *bufio.Reader, clusterID string, nodeCount
fmt.Fprintf(cli.Stdout, "Documentation: %s\n", color.GreenString("https://cloud.vespa.ai/en/reference/services"))
fmt.Fprintf(cli.Stdout, "Example: %s\nExample: %s\n\n", color.YellowString("4"), color.YellowString("[2,8]"))
validator := func(input string) error {
- _, _, err := xml.ParseNodeCount(input)
+ min, _, err := xml.ParseNodeCount(input)
+ if min < 2 {
+ return fmt.Errorf("at least 2 nodes are required for all clusters in a production environment")
+ }
return err
}
return prompt(cli, stdin, fmt.Sprintf("How many nodes should the %s cluster have?", color.CyanString(clusterID)), nodeCount, validator)