mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
Don't try synthesizing cluster when not in dev mode
This commit is contained in:
parent
041817b300
commit
9533d3d8a6
1 changed files with 8 additions and 2 deletions
|
|
@ -314,10 +314,13 @@ func (c *ServerCommand) Run(args []string) int {
|
|||
coreConfig.ClusterAddr = envCA
|
||||
} else {
|
||||
var addrToUse string
|
||||
if coreConfig.ClusterAddr == "" && coreConfig.RedirectAddr != "" {
|
||||
switch {
|
||||
case coreConfig.ClusterAddr == "" && coreConfig.RedirectAddr != "":
|
||||
addrToUse = coreConfig.RedirectAddr
|
||||
} else if dev {
|
||||
case dev:
|
||||
addrToUse = fmt.Sprintf("http://%s", config.Listeners[0].Config["address"])
|
||||
default:
|
||||
goto CLUSTER_SYNTHESIS_COMPLETE
|
||||
}
|
||||
u, err := url.ParseRequestURI(addrToUse)
|
||||
if err != nil {
|
||||
|
|
@ -345,6 +348,9 @@ func (c *ServerCommand) Run(args []string) int {
|
|||
u.Scheme = "https"
|
||||
coreConfig.ClusterAddr = u.String()
|
||||
}
|
||||
|
||||
CLUSTER_SYNTHESIS_COMPLETE:
|
||||
|
||||
if coreConfig.ClusterAddr != "" {
|
||||
// Force https as we'll always be TLS-secured
|
||||
u, err := url.ParseRequestURI(coreConfig.ClusterAddr)
|
||||
|
|
|
|||
Loading…
Reference in a new issue