consul
consul copied to clipboard
Backport of Separate port and socket path validation for local agent into release/1.11.x
Backport
This PR is auto-generated from #13906 to be assessed for backporting due to the inclusion of the label backport/1.11.
WARNING automatic cherry-pick of commits failed. Commits will require human attention.
The below text is copied from the body of the original PR.
Description
PR #12881 Introduced a requirement for either port or socket path to be provided in all requests. Due to a race in automatic port assignment within the agent, automatic assignment needs to be moved from the request-building stage to the locked registration stage post-validation. One solution (this PR) is to exempt the port requirement from request validation when the request is coming from an agent that is trying to do auto-assignment.
Testing & Reproduction steps
- Manually registering a service from the agent still works with and without a port specified.
- Existing unit tests seem to cover many cases, and pass without need for changes.
Links
PR #12881 Port assignment issue Follow-on PR that will need this
PR Checklist
- [x] updated test coverage
- [N/A] external facing docs updated
- [N/A] not a security concern
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement
Learn more about why HashiCorp requires a CLA and what the CLA includes
temp seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you already have a GitHub account, please add the email address used for this commit to your account.
Have you signed the CLA already but the status is still pending? Recheck it.
I talked to @skpratt offline and the original PR doesn't actually need to be backported, so going to close.