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

Handle Consul API URL protocol mismatch #10082

Merged
merged 4 commits into from
Feb 25, 2021
Merged

Handle Consul API URL protocol mismatch #10082

merged 4 commits into from
Feb 25, 2021

Conversation

davemay99
Copy link
Contributor

This fixes a bug in nomad operator debug that occurred when an HTTPS address was specified for Consul, either through the -consul-http-addr CLI argument or CONSUL_HTTP_ADDR environment variable

Fixes #10081

CHANGELOG.md Outdated
@@ -8,6 +8,7 @@ IMPROVEMENTS:
* agent: Removed leading whitespace from JSON-formatted log output. [[GH-9795](https://github.com/hashicorp/nomad/issues/9795)]
* cli: Added optional `-task <task-name>` flag to `alloc logs` to match `alloc exec` [[GH-10026](https://github.com/hashicorp/nomad/issues/10026)]
* cli: Improved `scaling policy` commands with -verbose, auto-completion, and prefix-matching [[GH-9964](https://github.com/hashicorp/nomad/issues/9964)]
* cli: Fixed a bug where `nomad operator debug` incorrectly parsed https Consul API URLs. [[GH-9625](https://github.com/hashicorp/nomad/pull/10082)]
Copy link
Member

Choose a reason for hiding this comment

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

The 1.0.4 release build has already been cut; this will need to go into 1.1 unless it's a regression from 1.0.3.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe this has been broken from the beginning, so I understand the decision. I rebased and moved the change up to the 1.1.0 (Unreleased) section.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1064,6 +1064,10 @@ func (e *external) addr(defaultAddr string) string {
if strings.HasPrefix(e.addrVal, "http:") {
return e.addrVal
}
if strings.HasPrefix(e.addrVal, "https:") {
Copy link
Member

Choose a reason for hiding this comment

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

I was going to leave a comment about this being an awfully weird addressing scheme to support, but then I looked it up the details of the caller and apparently Consul supports TLS over UDS. So... ok then! 😀

@tgross tgross merged commit d164824 into master Feb 25, 2021
@tgross tgross deleted the b-debug-consuladdr branch February 25, 2021 13:22
@tgross tgross added this to the 1.1.0 milestone Mar 30, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nomad operator debug: Consul API calls fail when using https address
2 participants