21 lines
606 B
Nix
21 lines
606 B
Nix
{ lib }:
|
|
# TODO: Remove this compatibility bridge when route backend resolution reads registry.address directly.
|
|
let
|
|
endpointFields = address: { inherit address; };
|
|
|
|
collectFleetEndpoints = hosts:
|
|
lib.concatMapAttrs (
|
|
hostName: host:
|
|
lib.mapAttrs' (
|
|
entryName: address:
|
|
let
|
|
endpointName = if entryName == "self" then hostName else "${hostName}-${entryName}";
|
|
in
|
|
lib.nameValuePair endpointName (endpointFields address)
|
|
) (host.config.registry.address.${hostName} or { })
|
|
) hosts;
|
|
in
|
|
{
|
|
inherit collectFleetEndpoints endpointFields;
|
|
}
|