Fix eventing and worker name setup (#2204)
* Don't automatically create worker names, as this is now invalid for PKI workers * Fix a check in dev that clears out name/description in exactly the wrong cases * Change eventing setup to use a hostname-based ID instead of the name (which could change on every start anyways)
This commit is contained in:
1 parent
214ca9a668
commit
9a4545e59e
9 files changed
+75
-90
No files matched your search
@@ -3,6 +3,7 @@ package database
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/hashicorp/boundary/globals"
|
||||
"github.com/hashicorp/boundary/internal/cmd/base"
|
||||
@@ -191,17 +192,12 @@ func (c *InitCommand) Run(args []string) (retCode int) {
|
||||
return base.CommandCliError
|
||||
}
|
||||
|
||||
var serverName string
|
||||
switch {
|
||||
case c.Config.Controller == nil:
|
||||
serverName = "boundary-database-init"
|
||||
default:
|
||||
if _, err := c.Config.Controller.InitNameIfEmpty(); err != nil {
|
||||
c.UI.Error(err.Error())
|
||||
return base.CommandCliError
|
||||
}
|
||||
serverName = c.Config.Controller.Name + "/boundary-database-init"
|
||||
serverName, err := os.Hostname()
|
||||
if err != nil {
|
||||
c.UI.Error(fmt.Errorf("Unable to determine hostname: %w", err).Error())
|
||||
return base.CommandCliError
|
||||
}
|
||||
serverName = fmt.Sprintf("%s/boundary-database-init", serverName)
|
||||
if err := c.SetupEventing(c.Logger, c.StderrLock, serverName, base.WithEventerConfig(c.Config.Eventing)); err != nil {
|
||||
c.UI.Error(err.Error())
|
||||
return base.CommandCliError
|
||||
|
||||
@@ -3,6 +3,7 @@ package database
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/hashicorp/boundary/globals"
|
||||
"github.com/hashicorp/boundary/internal/cmd/base"
|
||||
@@ -148,17 +149,13 @@ func (c *MigrateCommand) Run(args []string) (retCode int) {
|
||||
c.UI.Error(err.Error())
|
||||
return base.CommandCliError
|
||||
}
|
||||
var serverName string
|
||||
switch {
|
||||
case c.Config.Controller == nil:
|
||||
serverName = "boundary-database-migrate"
|
||||
default:
|
||||
if _, err := c.Config.Controller.InitNameIfEmpty(); err != nil {
|
||||
c.UI.Error(err.Error())
|
||||
return base.CommandCliError
|
||||
}
|
||||
serverName = c.Config.Controller.Name + "/boundary-database-migrate"
|
||||
|
||||
serverName, err := os.Hostname()
|
||||
if err != nil {
|
||||
c.UI.Error(fmt.Errorf("Unable to determine hostname: %w", err).Error())
|
||||
return base.CommandCliError
|
||||
}
|
||||
serverName = fmt.Sprintf("%s/boundary-database-migrate", serverName)
|
||||
if err := c.srv.SetupEventing(
|
||||
c.srv.Logger,
|
||||
c.srv.StderrLock,
|
||||
|
||||
Reference in new issue
Block a user