mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
ucind: create machines in containers with published API ports
This commit is contained in:
@@ -6,11 +6,8 @@ import (
|
||||
"uncloud/internal/ucind"
|
||||
)
|
||||
|
||||
type createOptions struct {
|
||||
}
|
||||
|
||||
func NewCreateCommand() *cobra.Command {
|
||||
//opts := createOptions{}
|
||||
opts := ucind.CreateClusterOptions{}
|
||||
cmd := &cobra.Command{
|
||||
Use: "create [NAME]",
|
||||
Short: "Create a new cluster.",
|
||||
@@ -23,12 +20,15 @@ func NewCreateCommand() *cobra.Command {
|
||||
name = args[0]
|
||||
}
|
||||
|
||||
if err := p.CreateCluster(cmd.Context(), name, ucind.CreateClusterOptions{}); err != nil {
|
||||
if _, err := p.CreateCluster(cmd.Context(), name, opts); err != nil {
|
||||
return fmt.Errorf("create cluster '%s': %w", name, err)
|
||||
}
|
||||
fmt.Printf("Cluster '%s' created.\n", name)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Flags().IntVarP(&opts.Machines, "machines", "m", 1, "Number of machines to create.")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user