diff options
author | Eirik Nygaard <eirik.nygaard@yahooinc.com> | 2023-11-08 14:53:41 +0100 |
---|---|---|
committer | Eirik Nygaard <eirik.nygaard@yahooinc.com> | 2023-11-08 14:53:41 +0100 |
commit | ba1e176d64981cfd39f03ba72e2545a6833045d0 (patch) | |
tree | 013238960cf308135483bfc82a280765ea1509bf /client | |
parent | 96f6abe9caa338074ee39cb2fd566d3efff464c9 (diff) |
Require a minimum amount of nodes when creating deployment.xml
Diffstat (limited to 'client')
-rw-r--r-- | client/go/internal/cli/cmd/prod.go | 5 |
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) |