-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Diagnoses Consul Direct Access Check #11505
Conversation
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.
few comments but it looks good
vault/diagnose/storage_checks.go
Outdated
// versus directly to a remote server. We can only assume that the local address | ||
// is a server, not a client. | ||
func ConsulDirectAccess(config map[string]string) string { | ||
serviceRegistrationAddr := config["address"] |
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.
do we want to handle the case where address
isn't in config
?
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, good point!
vault/diagnose/storage_checks.go
Outdated
func ConsulDirectAccess(config map[string]string) string { | ||
serviceRegistrationAddr := config["address"] | ||
if !strings.Contains(serviceRegistrationAddr, "localhost") && !strings.Contains(serviceRegistrationAddr, "127.0.0.1") { | ||
return "consul storage does not connect to local agent, but directly to server" |
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.
does it make sense to const
this since we check for it in tests?
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.
Absolutely.
The logic checks if address is not localhost for any storage or SR configuration stanza. Warnings are moved before errors so they can be relayed even when a particular error occurs.