Diagnose Disk usage checks (#11673)

* Disk usage checks

* Move disk free earlier

* Move logic to helpers

* Bring over test logic from the ulimit PR

* imports

* Report error

* Get unit tests working
This commit is contained in:
Scott Miller
2021-05-27 10:17:52 -07:00
committed by GitHub
parent 55ad81203e
commit 1cf7637400
4 changed files with 81 additions and 418 deletions

View File

@@ -209,6 +209,9 @@ func (c *OperatorDiagnoseCommand) offlineDiagnostics(ctx context.Context) error
ctx, span := diagnose.StartSpan(ctx, "initialization")
defer span.End()
diagnose.Test(ctx, "disk-usage", diagnose.DiskUsageCheck)
server.flagConfigs = c.flagConfigs
config, err := server.parseConfig()
if err != nil {
@@ -400,7 +403,7 @@ SEALFAIL:
return nil
})
if config.HAStorage != nil && config.HAStorage.Type == storageTypeConsul {
diagnose.Test(ctx, "test-storage-tls-consul", func(ctx context.Context) error {
diagnose.Test(ctx, "test-ha-storage-tls-consul", func(ctx context.Context) error {
err = physconsul.SetupSecureTLS(api.DefaultConfig(), config.HAStorage.Config, server.logger, true)
if err != nil {
return err