-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diagnose V0: Storage End to End Checks #11468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, we may have to do some error parsing to test the permissions failure case but the best test for storage configuration and operation working is to just try it out. Cheap to do as well.
command/operator_diagnose.go
Outdated
|
||
// Attempt to use storage backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might break this out into it's own function for tidiness.
Co-authored-by: swayne275 <[email protected]>
…lt into diagnose-otel-integration
…ration # Conflicts: # command/operator_diagnose.go # command/operator_diagnose_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few style type things, but i think it looks good!
No reason to change if you disagree, i just thought those suggestions would be helpful.
"github.com/hashicorp/vault/sdk/physical" | ||
) | ||
|
||
const timeoutCallRead string = "lag Read" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you do a const
block here?
e.g.
const (
thing1 = "hello"
thing2 = "world"
...
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm only gonna put one comment for this class of thing, but could you also do the same with other consts and vars? i think it makes it a bit cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will do!
vault/diagnose/storage_checks.go
Outdated
// but I don't think List is ever going to break in isolation. | ||
func StorageEndToEndLatencyCheck(ctx context.Context, b physical.Backend) error { | ||
|
||
c2 := make(chan string, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think this channel needs to be buffered with the current code. you could also do a channel of errors (with nil check instead of success string) which would simplify the code a bit
same with c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, will do!
This PR writes, reads, and deletes a secret to physical storage in the root path during the operator diagnose command, with a timeout of 20 seconds. The check aims to diagnose latency issues to storage when vault is down.