File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,32 +3,32 @@ package client
33import "strconv"
44
55// Scale creates or destroys units to match the desired number
6- func (c * FleetClient ) Scale (component string , num int ) (err error ) {
6+ func (c * FleetClient ) Scale (component string , requested int ) (err error ) {
77 for {
88 components , err := c .Units (component )
99 if err != nil {
1010 return err
1111 }
12- if len (components ) == num {
12+ if len (components ) == requested {
1313 break
1414 }
15- if len (components ) < num {
16- num , err = c .nextUnit (component )
15+ if len (components ) < requested {
16+ num , err : = c .nextUnit (component )
1717 if err != nil {
1818 return err
1919 }
20- err : = c .Create (component + "@" + strconv .Itoa (num ))
20+ err = c .Create (component + "@" + strconv .Itoa (num ))
2121 if err != nil {
2222 return err
2323 }
2424 continue
2525 }
26- if len (components ) > num {
27- num , err = c .lastUnit (component )
26+ if len (components ) > requested {
27+ num , err : = c .lastUnit (component )
2828 if err != nil {
2929 return err
3030 }
31- err : = c .Destroy (component + "@" + strconv .Itoa (num ))
31+ err = c .Destroy (component + "@" + strconv .Itoa (num ))
3232 if err != nil {
3333 return err
3434 }
You can’t perform that action at this time.
0 commit comments