-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add -http-port option to change the HTTP API port #1167
Conversation
This is useful when pushing consul to PaaS like Cloud Foundry making the HTTP API easily routable.
@@ -849,6 +854,9 @@ func MergeConfig(a, b *Config) *Config { | |||
if b.BindAddr != "" { | |||
result.BindAddr = b.BindAddr | |||
} | |||
if b.HttpPort != 0 { | |||
result.Ports.HTTP = b.HttpPort | |||
} |
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.
Can we add a test case to ensure this merging works? There are examples in config_test.go
that you can piggyback on.
@railsguru this looks good, sorry for the delay! If we can just add the test case for the option, as well as update the CLI and HTTP documentation I think we can merge this. |
I got rid of the intermediate HttpPort variable and TestMergeConfig already also provides coverage. If there's any other documentation I should add let me know, thx! |
@railsguru, this needs to be documented here: http://www.consul.io/docs/agent/options.html. Can you update |
Done. I ended up doing some yak shaving and also created a pull request for middleman-hashicorp as the |
Thanks! The options doc is alphabetically sorted by config for discoverability. Would you mind moving this config to the appropriate place? |
@ryanbreen ah missed that cue, done! |
Awesome, thanks! |
Add -http-port option to change the HTTP API port
This is useful when pushing consul to PaaS like
Cloud Foundry making the HTTP API easily routable.