mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-04 06:15:02 -04:00
Ensure advertise address detection runs without a specified HA backend
Ping #840
This commit is contained in:
parent
0914d931b3
commit
6e46e56b21
1 changed files with 9 additions and 1 deletions
|
|
@ -116,6 +116,7 @@ func (c *ServerCommand) Run(args []string) int {
|
|||
|
||||
coreConfig := &vault.CoreConfig{
|
||||
Physical: backend,
|
||||
AdvertiseAddr: config.Backend.AdvertiseAddr,
|
||||
HAPhysical: nil,
|
||||
AuditBackends: c.AuditBackends,
|
||||
CredentialBackends: c.CredentialBackends,
|
||||
|
|
@ -147,7 +148,14 @@ func (c *ServerCommand) Run(args []string) int {
|
|||
}
|
||||
|
||||
// Attempt to detect the advertise address possible
|
||||
if detect, ok := coreConfig.HAPhysical.(physical.AdvertiseDetect); ok && coreConfig.AdvertiseAddr == "" {
|
||||
var detect physical.AdvertiseDetect
|
||||
var ok bool
|
||||
if coreConfig.HAPhysical != nil {
|
||||
detect, ok = coreConfig.HAPhysical.(physical.AdvertiseDetect)
|
||||
} else {
|
||||
detect, ok = coreConfig.Physical.(physical.AdvertiseDetect)
|
||||
}
|
||||
if ok && coreConfig.AdvertiseAddr == "" {
|
||||
advertise, err := c.detectAdvertise(detect, config)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error detecting advertise address: %s", err))
|
||||
|
|
|
|||
Loading…
Reference in a new issue