mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 12:03:33 +00:00
refactor: more descriptive error for using --connect with 'uc machine init'
This commit is contained in:
@@ -150,7 +150,10 @@ Connection methods:
|
|||||||
func initCluster(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine, opts initOptions) error {
|
func initCluster(ctx context.Context, uncli *cli.CLI, remoteMachine *cli.RemoteMachine, opts initOptions) error {
|
||||||
if uncli.Config == nil {
|
if uncli.Config == nil {
|
||||||
// Config is nil when connecting directly to a remote machine (--connect) without using Uncloud config.
|
// Config is nil when connecting directly to a remote machine (--connect) without using Uncloud config.
|
||||||
return fmt.Errorf("do not specify --connect when initialising a new cluster")
|
return fmt.Errorf(
|
||||||
|
"do not use --connect when initialising a new cluster: --connect is for overriding the connection " +
|
||||||
|
"to an existing cluster, but 'machine init' creates a new one and writes the new cluster context " +
|
||||||
|
"to the Uncloud config file (--uncloud-config)")
|
||||||
}
|
}
|
||||||
|
|
||||||
netPrefix, err := netip.ParsePrefix(opts.network)
|
netPrefix, err := netip.ParsePrefix(opts.network)
|
||||||
|
|||||||
Reference in New Issue
Block a user