Skip to content
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

Merged
merged 32 commits into from
May 2, 2021
Merged

Conversation

HridoyRoy
Copy link
Contributor

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.

Copy link
Contributor

@swayne275 swayne275 left a 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

// 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"]
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good point!

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"
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely.

Base automatically changed from diagnose-consul-3 to master May 2, 2021 20:33
@vercel vercel bot temporarily deployed to Preview – vault-storybook May 2, 2021 20:41 Inactive
@vercel vercel bot temporarily deployed to Preview – vault May 2, 2021 20:41 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook May 2, 2021 21:05 Inactive
@vercel vercel bot temporarily deployed to Preview – vault May 2, 2021 21:05 Inactive
@HridoyRoy HridoyRoy merged commit 52d70a4 into master May 2, 2021
@HridoyRoy HridoyRoy deleted the diagnose-consul-params-check branch May 2, 2021 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants