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

[NET-9468, NET-9901] Use /v1/exported-services instead of config entry list for exportedServices func #1948

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

nathancoleman
Copy link
Member

@nathancoleman nathancoleman commented Jun 5, 2024

The /v1/config/exported-services endpoint (docs) -- which is currently used for the exportedServices func -- simply returns the config entries as they exist. This means that a wildcarded export, for example, will simply return the wildcard.

In contrast, the /v1/exported-services endpoint (docs) -- introduced in hashicorp/consul#20015 -- resolves wildcards to the resulting list of exported service names and resolves sameness groups to the resulting list of peers and partitions.

With this change, wildcard exports are now expanded out to the full list of exported services instead of just * for the service name:

$ consul-template -template "exported_services.tmpl:out.txt" -once && cat out.txt

source exported from partition default to partitions [other]
destination exported from partition other to partitions [default]
destination2 exported from partition other to partitions [default]
destination3 exported from partition other to partitions [default]

Note

This change means that users must be on Consul 1.17.3+ in order to use the exportedServices function (docs)

@nathancoleman nathancoleman requested review from blake and jmurret June 5, 2024 15:10
@nathancoleman nathancoleman changed the title [WIP] Use /v1/exported-services instead of config entry list for exportedServices func Use /v1/exported-services instead of config entry list for exportedServices func Jun 5, 2024
@nathancoleman nathancoleman marked this pull request as ready for review June 5, 2024 20:06
@nathancoleman nathancoleman merged commit 63d9257 into main Jun 5, 2024
54 checks passed
@nathancoleman nathancoleman deleted the exported-services-endpoint branch June 5, 2024 20:40
@nathancoleman nathancoleman changed the title Use /v1/exported-services instead of config entry list for exportedServices func [NET-9468] Use /v1/exported-services instead of config entry list for exportedServices func Jun 5, 2024
@nathancoleman nathancoleman changed the title [NET-9468] Use /v1/exported-services instead of config entry list for exportedServices func [NET-9468, NET-9901] Use /v1/exported-services instead of config entry list for exportedServices func Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants