File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,21 @@ func Start(b backend.Backend, targets []string) error {
7979 return nil
8080}
8181
82+ // checkRequiredKeys exist in etcd
83+ func checkRequiredKeys () error {
84+ if err := config .CheckConfig ("/deis/platform/" , "domain" ); err != nil {
85+ return fmt .Errorf (`Missing platform domain, use:
86+ deisctl config platform set domain=<your-domain>` )
87+ }
88+
89+ if err := config .CheckConfig ("/deis/platform/" , "sshPrivateKey" ); err != nil {
90+ fmt .Printf (`Warning: Missing sshPrivateKey, "deis run" will be unavailable. Use:
91+ deisctl config platform set sshPrivateKey=<path-to-key>
92+ ` )
93+ }
94+ return nil
95+ }
96+
8297func StartPlatform (b backend.Backend ) error {
8398
8499 outchan := make (chan string )
@@ -256,6 +271,10 @@ func Install(b backend.Backend, targets []string) error {
256271
257272func InstallPlatform (b backend.Backend ) error {
258273
274+ if err := checkRequiredKeys (); err != nil {
275+ return err
276+ }
277+
259278 outchan := make (chan string )
260279 errchan := make (chan error )
261280 var wg sync.WaitGroup
Original file line number Diff line number Diff line change @@ -32,6 +32,23 @@ func Config() error {
3232 return doConfig (args )
3333}
3434
35+ // CheckConfig looks for a value at a keyspace path
36+ // and returns an error if a value is not found
37+ func CheckConfig (root string , k string ) error {
38+
39+ client , err := getEtcdClient ()
40+ if err != nil {
41+ return err
42+ }
43+
44+ _ , err = doConfigGet (client , root , []string {k })
45+ if err != nil {
46+ return err
47+ }
48+
49+ return nil
50+ }
51+
3552// Flags for config package
3653var Flags struct {
3754}
You can’t perform that action at this time.
0 commit comments