Skip to content

Commit

Permalink
Diagnose Disk usage checks (hashicorp#11673)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sgmiller authored and AndreyZamyslov committed Jun 10, 2021
1 parent c0c1a26 commit 177ac37
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 418 deletions.
5 changes: 4 additions & 1 deletion command/operator_diagnose.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 177ac37

Please sign in to comment.