Skip to content

Commit

Permalink
Merge pull request #99 from rgbkrk/segment-to-node
Browse files Browse the repository at this point in the history
Back to nodes!
  • Loading branch information
rgbkrk committed Mar 18, 2016
2 parents 9181afb + 0b8c7c8 commit cbbae4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ Be sure to move `carina.exe` to a directory on your `%PATH%`.
$ export CARINA_USERNAME=trythingsout
$ export CARINA_APIKEY=$RACKSPACE_APIKEY
$ carina list
ClusterName Flavor Segments AutoScale Status
ClusterName Flavor Nodes AutoScale Status
mycluster container1-4G 1 false active
$ carina create newone
newone container1-4G 1 false new
$ carina create another --wait --autoscale
another container1-4G 1 true active
$ carina list
ClusterName Flavor Segments AutoScale Status
ClusterName Flavor Nodes AutoScale Status
mycluster container1-4G 1 false active
newone container1-4G 1 false active
another container1-4G 1 true active
Expand Down Expand Up @@ -106,7 +106,7 @@ Commands:
Create a swarm cluster
--wait wait for swarm cluster to come online (or error)
--segments=1 number of segments for the initial cluster
--nodes=1 number of nodes for the initial cluster
--autoscale whether autoscale is on or off
get <cluster-name>
Expand All @@ -115,10 +115,10 @@ Commands:
list
List swarm clusters
grow --segments=SEGMENTS <cluster-name>
Grow a cluster by the requested number of segments
grow --nodes=NODES <cluster-name>
Grow a cluster by the requested number of nodes
--segments=SEGMENTS number of segments to increase the cluster by
--nodes=NODES number of nodes to increase the cluster by
credentials [<flags>] <cluster-name>
download credentials
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func New() *Application {

createCommand := new(CreateCommand)
createCommand.WaitClusterCommand = cap.NewWaitClusterCommand(ctx, "create", "Create a swarm cluster")
createCommand.Flag("segments", "number of segments for the initial cluster").Default("1").IntVar(&createCommand.Nodes)
createCommand.Flag("nodes", "number of nodes for the initial cluster").Default("1").IntVar(&createCommand.Nodes)
createCommand.Flag("autoscale", "whether autoscale is on or off").BoolVar(&createCommand.AutoScale)
createCommand.Action(createCommand.Create)

Expand All @@ -171,8 +171,8 @@ func New() *Application {
listCommand.Action(listCommand.List).Hidden()

growCommand := new(GrowCommand)
growCommand.ClusterCommand = cap.NewClusterCommand(ctx, "grow", "Grow a cluster by the requested number of segments")
growCommand.Flag("by", "number of segments to increase the cluster by").Required().IntVar(&growCommand.Nodes)
growCommand.ClusterCommand = cap.NewClusterCommand(ctx, "grow", "Grow a cluster by the requested number of nodes")
growCommand.Flag("by", "number of nodes to increase the cluster by").Required().IntVar(&growCommand.Nodes)
growCommand.Action(growCommand.Grow)

autoscaleCommand := new(AutoScaleCommand)
Expand Down Expand Up @@ -656,7 +656,7 @@ const CarinaHomeDirEnvVar = "CARINA_HOME"
func (carina *CreateCommand) Create(pc *kingpin.ParseContext) (err error) {
return carina.clusterApplyWait(func(clusterName string) (*libcarina.Cluster, error) {
if carina.Nodes < 1 {
return nil, errors.New("segments must be >= 1")
return nil, errors.New("nodes must be >= 1")
}
nodes := libcarina.Number(carina.Nodes)

Expand Down Expand Up @@ -846,7 +846,7 @@ func writeClusterHeader(w *tabwriter.Writer) (err error) {
headerFields := []string{
"ClusterName",
"Flavor",
"Segments",
"Nodes",
"AutoScale",
"Status",
}
Expand Down

0 comments on commit cbbae4c

Please sign in to comment.