diff --git a/deps/rabbitmq_peer_discovery_etcd/priv/schema/rabbitmq_peer_discovery_etcd.schema b/deps/rabbitmq_peer_discovery_etcd/priv/schema/rabbitmq_peer_discovery_etcd.schema index c88b9a249f..d819cb6199 100644 --- a/deps/rabbitmq_peer_discovery_etcd/priv/schema/rabbitmq_peer_discovery_etcd.schema +++ b/deps/rabbitmq_peer_discovery_etcd/priv/schema/rabbitmq_peer_discovery_etcd.schema @@ -1,4 +1,4 @@ -%% host +%% etcd host {mapping, "cluster_formation.etcd.host", "rabbit.cluster_formation.peer_discovery_etcd.etcd_host", [ {datatype, string} @@ -12,6 +12,49 @@ fun(Conf) -> end end}. +%% etcd port + +{mapping, "cluster_formation.etcd.port", "rabbit.cluster_formation.peer_discovery_etcd.etcd_port", [ + {datatype, integer}, + {validators, ["non_negative_integer"]} +]}. + +{translation, "rabbit.cluster_formation.peer_discovery_etcd.etcd_port", +fun(Conf) -> + case cuttlefish:conf_get("cluster_formation.etcd.port", Conf, undefined) of + undefined -> cuttlefish:unset(); + Value -> Value + end +end}. + +%% etcd scheme + +{mapping, "cluster_formation.etcd.scheme", "rabbit.cluster_formation.peer_discovery_etcd.etcd_scheme", [ + {datatype, string} +]}. + +{translation, "rabbit.cluster_formation.peer_discovery_etcd.etcd_scheme", +fun(Conf) -> + case cuttlefish:conf_get("cluster_formation.etcd.scheme", Conf, undefined) of + undefined -> cuttlefish:unset(); + Value -> Value + end +end}. + +%% etcd key prefix + +{mapping, "cluster_formation.etcd.key_prefix", "rabbit.cluster_formation.peer_discovery_etcd.etcd_prefix", [ + {datatype, string} +]}. + +{translation, "rabbit.cluster_formation.peer_discovery_etcd.etcd_prefix", +fun(Conf) -> + case cuttlefish:conf_get("cluster_formation.etcd.key_prefix", Conf, undefined) of + undefined -> cuttlefish:unset(); + Value -> Value + end +end}. + %% ttl {mapping, "cluster_formation.etcd.ttl", "rabbit.cluster_formation.peer_discovery_etcd.etcd_ttl", [ diff --git a/deps/rabbitmq_peer_discovery_etcd/test/config_schema_SUITE_data/rabbitmq_peer_discovery_etcd.snippets b/deps/rabbitmq_peer_discovery_etcd/test/config_schema_SUITE_data/rabbitmq_peer_discovery_etcd.snippets index 1c9690ca55..4d42fda5dd 100644 --- a/deps/rabbitmq_peer_discovery_etcd/test/config_schema_SUITE_data/rabbitmq_peer_discovery_etcd.snippets +++ b/deps/rabbitmq_peer_discovery_etcd/test/config_schema_SUITE_data/rabbitmq_peer_discovery_etcd.snippets @@ -9,6 +9,36 @@ ]} ], [rabbitmq_peer_discovery_etcd] }, + {etcd_port, "cluster_formation.etcd.port = 7979", [ + {rabbit, [ + {cluster_formation, [ + {peer_discovery_etcd, [ + {etcd_port, 7979} + ]} + ]} + ]} + ], [rabbitmq_peer_discovery_etcd] + }, + {etcd_key_prefix, "cluster_formation.etcd.scheme = https", [ + {rabbit, [ + {cluster_formation, [ + {peer_discovery_etcd, [ + {etcd_scheme, "https"} + ]} + ]} + ]} + ], [rabbitmq_peer_discovery_etcd] + }, + {etcd_key_prefix, "cluster_formation.etcd.key_prefix = rabbit_", [ + {rabbit, [ + {cluster_formation, [ + {peer_discovery_etcd, [ + {etcd_prefix, "rabbit_"} + ]} + ]} + ]} + ], [rabbitmq_peer_discovery_etcd] + }, {etcd_ttl, "cluster_formation.etcd.ttl = 60", [ {rabbit, [ {cluster_formation, [