Add a hosts create command (#25)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-05-04 23:04:55 -04:00
1 parent 17fffe7c23
commit e3c7ca3070
8 files changed
+341 -94

No files matched your search

+12 -12
View File
@@ -21,7 +21,6 @@ type Command struct {
*base.Command
*base.Server
ShutdownCh chan struct{}
SighupCh chan struct{}
childSighupCh []chan struct{}
ReloadedCh chan struct{}
@@ -244,11 +243,11 @@ func (c *Command) Run(args []string) int {
c.childSighupCh = append(c.childSighupCh, controllerSighupCh)
devController := &controllercmd.Command{
Command: c.Command,
Server: c.Server,
ShutdownCh: childShutdownCh,
SighupCh: controllerSighupCh,
Config: devConfig,
Command: c.Command,
Server: c.Server,
ExtShutdownCh: childShutdownCh,
SighupCh: controllerSighupCh,
Config: devConfig,
}
if err := devController.Start(); err != nil {
c.UI.Error(err.Error())
@@ -258,11 +257,11 @@ func (c *Command) Run(args []string) int {
workerSighupCh := make(chan struct{})
c.childSighupCh = append(c.childSighupCh, workerSighupCh)
devWorker := &workercmd.Command{
Command: c.Command,
Server: c.Server,
ShutdownCh: childShutdownCh,
SighupCh: workerSighupCh,
Config: devConfig,
Command: c.Command,
Server: c.Server,
ExtShutdownCh: childShutdownCh,
SighupCh: workerSighupCh,
Config: devConfig,
}
if err := devWorker.Start(); err != nil {
c.UI.Error(err.Error())
@@ -286,7 +285,8 @@ func (c *Command) Run(args []string) int {
case <-c.ShutdownCh:
c.UI.Output("==> Watchtower dev environment shutdown triggered")
close(childShutdownCh)
childShutdownCh <- struct{}{}
childShutdownCh <- struct{}{}
shutdownTriggered = true