summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorEirik Nygaard <eirik.nygaard@yahooinc.com>2023-11-08 14:53:41 +0100
committerEirik Nygaard <eirik.nygaard@yahooinc.com>2023-11-08 14:53:41 +0100
commitba1e176d64981cfd39f03ba72e2545a6833045d0 (patch)
tree013238960cf308135483bfc82a280765ea1509bf /client
parent96f6abe9caa338074ee39cb2fd566d3efff464c9 (diff)
Require a minimum amount of nodes when creating deployment.xml
Diffstat (limited to 'client')
-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)