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

Fix GRPCUseTLS flag HTTP API mapping #8771

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

amenzhinsky
Copy link
Contributor

Currently HTTP APi doesn't recognize snake-cased grpc_use_tls option whereas loading from a config file works as expected, this fixes the following:

curl -X PUT -d '{
  "name": "test",
  "port": 6060,
  "check": {
    "grpc": "127.0.0.1:8080/test",
    "grpc_use_tls": true,
    "interval": "5s"
  }
}' http://127.0.0.1:8500/v1/agent/service/register

Request decode failed: json: unknown field "grpc_use_tls"

I know there was a lot of copy-pasting just to make it work 😢 probably it can be improved later for all fields.

Can be worked around now: "GRPCUseTLS": true

@dnephin dnephin added theme/api Relating to the HTTP API interface type/bug Feature does not function as expected labels Oct 20, 2020
Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Thank you for this fix!

Looks good! I think the only thing that is missing is a changelog entry. I've pushed a commit with the changelog entry.

@dnephin dnephin merged commit 8b601fd into hashicorp:master Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/api Relating to the HTTP API interface type/bug Feature does not function as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants