mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
Edge cases in the skipping gathering and output logic (#11752)
* Edge cases in the skipping gathering and output logic * Fix unit test
This commit is contained in:
@@ -302,7 +302,8 @@ func (c *OperatorDiagnoseCommand) offlineDiagnostics(ctx context.Context) error
|
||||
var configSR sr.ServiceRegistration
|
||||
diagnose.Test(ctx, "service-discovery", func(ctx context.Context) error {
|
||||
if config.ServiceRegistration == nil || config.ServiceRegistration.Config == nil {
|
||||
return fmt.Errorf("No service registration config")
|
||||
diagnose.Skipped(ctx, "no service registration configured")
|
||||
return nil
|
||||
}
|
||||
srConfig := config.ServiceRegistration.Config
|
||||
|
||||
@@ -397,9 +398,13 @@ SEALFAIL:
|
||||
return nil
|
||||
})
|
||||
diagnose.Test(ctx, "test-consul-direct-access-storage", func(ctx context.Context) error {
|
||||
dirAccess := diagnose.ConsulDirectAccess(config.HAStorage.Config)
|
||||
if dirAccess != "" {
|
||||
diagnose.Warn(ctx, dirAccess)
|
||||
if config.HAStorage == nil {
|
||||
diagnose.Skipped(ctx, "no HA storage configured")
|
||||
} else {
|
||||
dirAccess := diagnose.ConsulDirectAccess(config.HAStorage.Config)
|
||||
if dirAccess != "" {
|
||||
diagnose.Warn(ctx, dirAccess)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
@@ -430,7 +435,7 @@ SEALFAIL:
|
||||
|
||||
var lns []listenerutil.Listener
|
||||
diagnose.Test(ctx, "init-listeners", func(ctx context.Context) error {
|
||||
disableClustering := config.HAStorage.DisableClustering
|
||||
disableClustering := config.HAStorage != nil && config.HAStorage.DisableClustering
|
||||
infoKeys := make([]string, 0, 10)
|
||||
info := make(map[string]string)
|
||||
var listeners []listenerutil.Listener
|
||||
|
||||
Reference in New Issue
Block a user