feat(worker): save workerAuth request to a file
This commit is contained in:
1 parent
37cc61e4c9
commit
594e6e82b5
4 files changed
+66
No files matched your search
@@ -718,6 +718,19 @@ func (c *Command) Run(args []string) int {
|
||||
c.Info["worker auth current key id"] = c.worker.WorkerAuthCurrentKeyId
|
||||
c.InfoKeys = append(c.InfoKeys, "worker auth storage path")
|
||||
c.Info["worker auth storage path"] = c.worker.WorkerAuthStorage.BaseDir()
|
||||
if err := c.StoreWorkerAuthReq(c.worker.WorkerAuthRegistrationRequest, c.worker.WorkerAuthStorage.BaseDir()); err != nil {
|
||||
// Shutdown on failure
|
||||
retErr := fmt.Errorf("Error storing worker auth request: %w", err)
|
||||
if err := c.worker.Shutdown(); err != nil {
|
||||
c.UI.Error(retErr.Error())
|
||||
retErr = fmt.Errorf("Error shutting down worker: %w", err)
|
||||
}
|
||||
c.UI.Error(retErr.Error())
|
||||
if err := c.controller.Shutdown(); err != nil {
|
||||
c.UI.Error(fmt.Errorf("Error with controller shutdown: %w", err).Error())
|
||||
}
|
||||
return base.CommandCliError
|
||||
}
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
|
||||
Reference in new issue
Block a user