mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-09 00:33:28 -04:00
Fix diagnose panic when configuration file does not exist (#11932)
* Fix diagnose panic when configuration file does not exist * Addressing comments * Update command/operator_diagnose.go Co-authored-by: Hridoy Roy <roy@hashicorp.com> Co-authored-by: Hridoy Roy <roy@hashicorp.com>
This commit is contained in:
parent
8096e7d856
commit
a6d73e3dc2
2 changed files with 4 additions and 1 deletions
|
|
@ -242,6 +242,9 @@ func (c *OperatorDiagnoseCommand) offlineDiagnostics(ctx context.Context) error
|
|||
}
|
||||
return nil
|
||||
})
|
||||
if config == nil {
|
||||
return fmt.Errorf("No vault server configuration found.")
|
||||
}
|
||||
|
||||
var metricSink *metricsutil.ClusterMetricSink
|
||||
var metricsHelper *metricsutil.MetricsHelper
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ package configutil
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/hashicorp/hcl/hcl/token"
|
||||
"io/ioutil"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/hcl"
|
||||
"github.com/hashicorp/hcl/hcl/ast"
|
||||
"github.com/hashicorp/hcl/hcl/token"
|
||||
"github.com/hashicorp/vault/sdk/helper/parseutil"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue