Skip to content

Conversation

@Davidcode-png
Copy link
Contributor

Description

This PR introduces support for listing exported services in Consul and the following changes were made:

Added ServiceConsumer model.
Implemented the PeeringList method to handle the request GET /v1/exported-services.
Added a test ExportedServicesTest_ListExportedServices to validate changes.

Related Issues

Additional Context

Addresses issue #529

Checklist

Please make sure to check the following before submitting your pull request:

  • Did you read the contributing guidelines?
  • Did you update the docs?
  • Did you write any tests to validate this change?


namespace Consul
{
public class ServiceConsumer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be in favor of keeping the class names close to the original definitions from consul -> https://github.com/hashicorp/consul/blob/159d7a61f268e8d50a51466b5de56eec49866d3f/api/exported_services.go#L6C6-L24

var cutOffVersion = SemanticVersion.Parse("1.17.3");
Skip.If(AgentVersion < cutOffVersion, $"Current version is {AgentVersion}, but this test is only supported from Consul {cutOffVersion}");
var result = await _client.ExportedServices.ListExportedService();
Assert.NotNull(result.Response);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be more strict with checks here (e.g., the returned list is not empty, etc)

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