mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +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
|
return nil
|
||||||
})
|
})
|
||||||
|
if config == nil {
|
||||||
|
return fmt.Errorf("No vault server configuration found.")
|
||||||
|
}
|
||||||
|
|
||||||
var metricSink *metricsutil.ClusterMetricSink
|
var metricSink *metricsutil.ClusterMetricSink
|
||||||
var metricsHelper *metricsutil.MetricsHelper
|
var metricsHelper *metricsutil.MetricsHelper
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ package configutil
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/hashicorp/hcl/hcl/token"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/hcl"
|
"github.com/hashicorp/hcl"
|
||||||
"github.com/hashicorp/hcl/hcl/ast"
|
"github.com/hashicorp/hcl/hcl/ast"
|
||||||
|
"github.com/hashicorp/hcl/hcl/token"
|
||||||
"github.com/hashicorp/vault/sdk/helper/parseutil"
|
"github.com/hashicorp/vault/sdk/helper/parseutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user