|
|
@@ -287,6 +287,15 @@ fields(cluster_dns) ->
|
|
|
desc => ?DESC(cluster_dns_name),
|
|
|
'readOnly' => true
|
|
|
}
|
|
|
+ )},
|
|
|
+ {"record_type",
|
|
|
+ sc(
|
|
|
+ hoconsc:enum([a, srv]),
|
|
|
+ #{
|
|
|
+ default => a,
|
|
|
+ desc => ?DESC(cluster_dns_record_type),
|
|
|
+ 'readOnly' => true
|
|
|
+ }
|
|
|
)}
|
|
|
];
|
|
|
fields(cluster_etcd) ->
|
|
|
@@ -1009,7 +1018,7 @@ tr_override_conf_file(Conf, Filename) ->
|
|
|
|
|
|
tr_cluster_discovery(Conf) ->
|
|
|
Strategy = conf_get("cluster.discovery_strategy", Conf),
|
|
|
- {Strategy, filter(options(Strategy, Conf))}.
|
|
|
+ {Strategy, filter(cluster_options(Strategy, Conf))}.
|
|
|
|
|
|
-spec tr_logger_level(hocon:config()) -> logger:level().
|
|
|
tr_logger_level(Conf) ->
|
|
|
@@ -1267,9 +1276,9 @@ sc(Type, Meta) -> hoconsc:mk(Type, Meta).
|
|
|
|
|
|
map(Name, Type) -> hoconsc:map(Name, Type).
|
|
|
|
|
|
-options(static, Conf) ->
|
|
|
+cluster_options(static, Conf) ->
|
|
|
[{seeds, conf_get("cluster.static.seeds", Conf, [])}];
|
|
|
-options(mcast, Conf) ->
|
|
|
+cluster_options(mcast, Conf) ->
|
|
|
{ok, Addr} = inet:parse_address(conf_get("cluster.mcast.addr", Conf)),
|
|
|
{ok, Iface} = inet:parse_address(conf_get("cluster.mcast.iface", Conf)),
|
|
|
Ports = conf_get("cluster.mcast.ports", Conf),
|
|
|
@@ -1280,11 +1289,12 @@ options(mcast, Conf) ->
|
|
|
{ttl, conf_get("cluster.mcast.ttl", Conf, 1)},
|
|
|
{loop, conf_get("cluster.mcast.loop", Conf, true)}
|
|
|
];
|
|
|
-options(dns, Conf) ->
|
|
|
+cluster_options(dns, Conf) ->
|
|
|
[
|
|
|
- {name, conf_get("cluster.dns.name", Conf)}
|
|
|
+ {name, conf_get("cluster.dns.name", Conf)},
|
|
|
+ {type, conf_get("cluster.dns.record_type", Conf)}
|
|
|
];
|
|
|
-options(etcd, Conf) ->
|
|
|
+cluster_options(etcd, Conf) ->
|
|
|
Namespace = "cluster.etcd.ssl",
|
|
|
SslOpts = fun(C) ->
|
|
|
Options = keys(Namespace, C),
|
|
|
@@ -1296,7 +1306,7 @@ options(etcd, Conf) ->
|
|
|
{node_ttl, conf_get("cluster.etcd.node_ttl", Conf, 60)},
|
|
|
{ssl_options, filter(SslOpts(Conf))}
|
|
|
];
|
|
|
-options(k8s, Conf) ->
|
|
|
+cluster_options(k8s, Conf) ->
|
|
|
[
|
|
|
{apiserver, conf_get("cluster.k8s.apiserver", Conf)},
|
|
|
{service_name, conf_get("cluster.k8s.service_name", Conf)},
|
|
|
@@ -1304,7 +1314,7 @@ options(k8s, Conf) ->
|
|
|
{namespace, conf_get("cluster.k8s.namespace", Conf)},
|
|
|
{suffix, conf_get("cluster.k8s.suffix", Conf, "")}
|
|
|
];
|
|
|
-options(manual, _Conf) ->
|
|
|
+cluster_options(manual, _Conf) ->
|
|
|
[].
|
|
|
|
|
|
to_atom(Atom) when is_atom(Atom) ->
|