Skip to content

Ordering of service providers from agent function #7999

@DavidePrincipi

Description

@DavidePrincipi

The current agent.list_service_providers() function returns an unordered list of services matching some search criteria.

Proposed solution

Extend the function behavior to sort the results using a standard priority scheme:

  1. a service on the same node first
  2. a service on the leader node second
  3. a service on other worker nodes third

This ensures that list index 0 contains the nearest service instance in terms of VPN hops.

Alternative sort orderings may be implemented in the future; for this, an additional argument (e.g. sortby=) would be required.

Alternative solutions

Implement a separate function with the new behavior.

See also

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    ToDo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions