@@ -31,9 +31,8 @@ func ListUnits(b backend.Backend) error {
3131}
3232
3333// ListUnitFiles prints the contents of all defined unit files.
34- func ListUnitFiles (argv []string , b backend.Backend ) error {
35- err := b .ListUnitFiles ()
36- return err
34+ func ListUnitFiles (b backend.Backend ) error {
35+ return b .ListUnitFiles ()
3736}
3837
3938// Scale grows or shrinks the number of running components.
@@ -50,9 +49,9 @@ func Scale(targets []string, b backend.Backend) error {
5049 if err != nil {
5150 return err
5251 }
53- // the router is the only component that can scale at the moment
52+ // the router, registry, and store-gateway are the only component that can scale at the moment
5453 if ! strings .Contains (component , "router" ) && ! strings .Contains (component , "registry" ) && ! strings .Contains (component , "store-gateway" ) {
55- return fmt .Errorf ("cannot scale %s components " , component )
54+ return fmt .Errorf ("cannot scale %s component " , component )
5655 }
5756 b .Scale (component , num , & wg , outchan , errchan )
5857 wg .Wait ()
@@ -88,8 +87,8 @@ func Start(targets []string, b backend.Backend) error {
8887 return nil
8988}
9089
91- // checkRequiredKeys exist in etcd
92- func checkRequiredKeys () error {
90+ // CheckRequiredKeys exist in etcd
91+ func CheckRequiredKeys () error {
9392 if err := config .CheckConfig ("/deis/platform/" , "domain" ); err != nil {
9493 return fmt .Errorf (`Missing platform domain, use:
9594deisctl config platform set domain=<your-domain>` )
@@ -243,12 +242,12 @@ func Journal(targets []string, b backend.Backend) error {
243242
244243// Install loads the definitions of components from local unit files.
245244// After Install, the components will be available to Start.
246- func Install (targets []string , b backend.Backend ) error {
245+ func Install (targets []string , b backend.Backend , checkKeys func () error ) error {
247246
248247 // if target is platform, install all services
249248 if len (targets ) == 1 {
250249 if targets [0 ] == PlatformCommand {
251- return InstallPlatform (b )
250+ return InstallPlatform (b , checkKeys )
252251 }
253252 if targets [0 ] == swarm {
254253 return InstallSwarm (b )
@@ -290,6 +289,7 @@ func installDefaultServices(b backend.Backend, wg *sync.WaitGroup, outchan chan
290289 outchan <- fmt .Sprintf ("Routing mesh..." )
291290 b .Create ([]string {"router@1" , "router@2" , "router@3" }, wg , outchan , errchan )
292291 wg .Wait ()
292+
293293}
294294
295295// Uninstall unloads the definitions of the specified components.
@@ -405,16 +405,15 @@ func Config(target string, action string, key []string) error {
405405// RefreshUnits overwrites local unit files with those requested.
406406// Downloading from the Deis project GitHub URL by tag or SHA is the only mechanism
407407// currently supported.
408- func RefreshUnits (dir string , tag string ) error {
408+ func RefreshUnits (dir , tag , url string ) error {
409409 dir = utils .ResolvePath (dir )
410410 // create the target dir if necessary
411411 if err := os .MkdirAll (dir , 0755 ); err != nil {
412412 return err
413413 }
414414 // download and save the unit files to the specified path
415- rootURL := "https://raw.githubusercontent.com/deis/deis/"
416415 for _ , unit := range units .Names {
417- src := rootURL + tag + "/deisctl/units/" + unit + ".service"
416+ src := fmt . Sprintf ( url , tag , unit )
418417 dest := filepath .Join (dir , unit + ".service" )
419418 res , err := http .Get (src )
420419 if err != nil {
0 commit comments