[sled-agent] avoid using hardcoded port number to reach MGS #6430
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this is one (and the easiest) of three cases i noted in #6363 where we find a service by looking up a SRV record, ignoring the port in that record, keeping IPs from that SRV lookup, and then finally pairing those addresses with a service's hardcoded port.
in this case, we were looking up the SRV record for Dendrite, then using the MGS port instead. this this technically works, because the two will be running together, but we can just get the right port from the get-go by looking for MGS's SRV record instead. so, do that.
this file also mentions MGS_PORT in
init_switch_config
, at which point it's more necessary: in that case, we're configuring our switch zone. so we know the address we want to reach - it's our own sled - and we just need to add the port of the service we want.