mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-08 00:02:32 -04:00
Use os.Hostname instead of a dependency that doesn't work on OpenBSD. (#13389)
This commit is contained in:
parent
6fbdf596af
commit
0cc6326088
1 changed files with 7 additions and 4 deletions
|
|
@ -11,6 +11,7 @@ import (
|
|||
"fmt"
|
||||
"hash"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
|
@ -42,7 +43,6 @@ import (
|
|||
"github.com/hashicorp/vault/sdk/logical"
|
||||
"github.com/hashicorp/vault/sdk/version"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"github.com/shirou/gopsutil/host"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -3034,7 +3034,6 @@ func (b *SystemBackend) handleInFlightRequestData(_ context.Context, req *logica
|
|||
resp.Data[logical.HTTPStatusCode] = http.StatusOK
|
||||
|
||||
return resp, nil
|
||||
|
||||
}
|
||||
|
||||
func (b *SystemBackend) handleMonitor(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
|
||||
|
|
@ -4156,10 +4155,14 @@ func (b *SystemBackend) rotateBarrierKey(ctx context.Context) error {
|
|||
|
||||
func (b *SystemBackend) handleHAStatus(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
|
||||
// We're always the leader if we're handling this request.
|
||||
h, _ := host.Info()
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
nodes := []HAStatusNode{
|
||||
{
|
||||
Hostname: h.Hostname,
|
||||
Hostname: hostname,
|
||||
APIAddress: b.Core.redirectAddr,
|
||||
ClusterAddress: b.Core.ClusterAddr(),
|
||||
ActiveNode: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue