Skip to content

Commit

Permalink
Joshd/sc 112629/bare servers add support for ssh via cmx (#415)
Browse files Browse the repository at this point in the history
* expose ssh port and endpoint
* fix multinode for vm
  • Loading branch information
jdewinne authored Oct 3, 2024
1 parent be946a1 commit 042804b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/vm_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (r *runners) InitVMCreate(parent *cobra.Command) *cobra.Command {
cmd.Flags().StringVar(&r.args.createClusterTTL, "ttl", "", "VM TTL (duration, max 48h)")
cmd.Flags().DurationVar(&r.args.createClusterWaitDuration, "wait", time.Second*0, "Wait duration for VM to be ready (leave empty to not wait)")
cmd.Flags().StringVar(&r.args.createClusterInstanceType, "instance-type", "", "The type of instance to use (e.g. r1.medium)")
cmd.Flags().StringArrayVar(&r.args.createClusterNodeGroups, "nodegroup", []string{}, "Node group to create (name=?,instance-type=?,nodes=?,disk=? format, can be specified multiple times). For each nodegroup, one of the following flags must be specified: name, instance-type, nodes or disk.")
cmd.Flags().StringArrayVar(&r.args.createClusterNodeGroups, "group", []string{}, "Group to create (name=?,instance-type=?,nodes=?,disk=? format, can be specified multiple times). For each group, one of the following flags must be specified: name, instance-type, nodes or disk.")

cmd.Flags().StringArrayVar(&r.args.createClusterTags, "tag", []string{}, "Tag to apply to the VM (key=value format, can be specified multiple times)")

Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/vm_group_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (r *runners) InitVMGroupList(parent *cobra.Command) *cobra.Command {
Short: "List groups for a vm",
Long: `List groups for a vm`,
Args: cobra.ExactArgs(1),
RunE: r.listVMNodeGroups,
RunE: r.listVMGroups,
ValidArgsFunction: r.completeVMIDs,
}
parent.AddCommand(cmd)
Expand All @@ -23,7 +23,7 @@ func (r *runners) InitVMGroupList(parent *cobra.Command) *cobra.Command {
return cmd
}

func (r *runners) listVMNodeGroups(cmd *cobra.Command, args []string) error {
func (r *runners) listVMGroups(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("vm id is required")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kotsclient/vm_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type CreateVMRequest struct {
NodeCount int `json:"node_count"`
DiskGiB int64 `json:"disk_gib"`
TTL string `json:"ttl"`
NodeGroups []VMNodeGroup `json:"node_groups"`
NodeGroups []VMNodeGroup `json:"groups"`
InstanceType string `json:"instance_type"`
Tags []types.Tag `json:"tags"`
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/types/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ type NodeGroup struct {

TotalCredits int64 `json:"total_credits,omitempty"` // this is only present after the cluster is stopped
MinutesBilled int64 `json:"minutes_billed"`

Nodes []*Node `json:"nodes"`
}

type Node struct {
Index int `json:"node_index"`

SSHPort int64 `json:"ssh_port,omitempty"`
SSHEndpoint string `json:"ssh_endpoint,omitempty"`
}

type ClusterDistributionStatus struct {
Expand Down

0 comments on commit 042804b

Please sign in to comment.