mrluc / peerage

Easy Elixir clusters, pluggable discovery. DNS-based (Kubernetes, Weave), UDP multicast, others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not all udp, dns provider config fields accept string values (should be consistent, for releases)

mrluc opened this issue · comments

Peerage.Via.Udp is configured with a default port value of 45_900, an integer. The version on hex errors when given a string (fix incoming).

This is a general concern: configuration from env (via REPLACE_OS_VARS=true, or via {:system,...} tuples, see this issue for discussion), commonly used in releases, will always be given as strings.

We did consider that, and most of the vital config handles strings now. But it should be across the board.

We use DeferredConfig on app startup now to support {:system, ...} and {:apply, {M, f, a}} style config. As both support arbitrary functions, conversion is gtg, and providers shouldn't need to worry about it:

config :peerage, 
  port: {:system, "PORT", 45_900, {String, :to_integer}}