mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00: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:
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user