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

Backport of api: enable selecting subset of services using rendezvous hashing into release/1.3.x #13747

Merged
merged 3 commits into from
Jul 13, 2022

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #12862 to be assessed for backporting due to the inclusion of the label backport/1.3.x.

WARNING automatic cherry-pick of commits failed. Commits will require human attention.

The below text is copied from the body of the original PR.


This PR adds the ?choose query parameter to the /v1/service/<service> endpoint.

The value of choose is in the form <number>|<key>, number is the number
of desired services and key is a value unique but consistent to the requester
(e.g. allocID).

Folks aren't really expected to use this API directly, but rather through consul-template / template block
which will soon be getting a new helper function making use of this query parameter.

Example,

curl 'localhost:4646/v1/service/redis?choose=2|abc123'

Part of #12575

Because this also includes updating CT, the template part works now as well.

@hashicorp-cla
Copy link

hashicorp-cla commented Jul 13, 2022

CLA assistant check
All committers have signed the CLA.

shoenig and others added 2 commits July 13, 2022 11:55
This PR adds the 'choose' query parameter to the '/v1/service/<service>' endpoint.

The value of 'choose' is in the form '<number>|<key>', number is the number
of desired services and key is a value unique but consistent to the requester
(e.g. allocID).

Folks aren't really expected to use this API directly, but rather through consul-template
which will soon be getting a new helper function making use of this query parameter.

Example,

curl 'localhost:4646/v1/service/redis?choose=2|abc123'

Note: consul-templte v0.29.1 includes the necessary nomadServices functionality.
Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
@shoenig shoenig force-pushed the backport/f-choose-services/sharply-flying-ibex branch from 267cc6d to 9b4293a Compare July 13, 2022 17:14
@shoenig shoenig merged commit 94b25ed into release/1.3.x Jul 13, 2022
@shoenig shoenig deleted the backport/f-choose-services/sharply-flying-ibex branch July 13, 2022 17:45
@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 11, 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.

None yet

3 participants