Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,18 @@ postgres:
another_processor_pool:
database: another_processor_db
size: 10
# Optional fields
# needs when canal configured to read postgres creds
vault_token_path: /var/run/secrets/kubernetes.io/serviceaccount/token
vault_role: machinegun

## Progressor namespaces settings

progressor:
prg_test_ns: some_processor_pool1

# Optional section
# if not defined then canal will not be started
canal:
url: http://vault
engine: kvv2
4 changes: 0 additions & 4 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
{<<"gproc">>,{pkg,<<"gproc">>,<<"0.9.0">>},0},
{<<"grpcbox">>,{pkg,<<"grpcbox">>,<<"0.17.1">>},1},
{<<"hackney">>,{pkg,<<"hackney">>,<<"1.18.0">>},1},
{<<"hamcrest">>,
{git,"https://github.com/basho/hamcrest-erlang.git",
{ref,"ad3dbab419762fc2d5821abb88b989da006b85c6"}},
2},
{<<"hpack">>,{pkg,<<"hpack_erl">>,<<"0.3.0">>},3},
{<<"idna">>,{pkg,<<"idna">>,<<"6.1.1">>},2},
{<<"jsone">>,{pkg,<<"jsone">>,<<"1.8.0">>},3},
Expand Down
22 changes: 20 additions & 2 deletions rel_scripts/configurator.escript
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,23 @@ procreg(YamlConfig) ->
).

epg_connector(YamlConfig) ->
[
Required = [
{databases, pg_databases(YamlConfig)},
{pools, pg_pools(YamlConfig)}
].
],
WithOptional = add_optional(
Required,
{vault_token_path, to_string(?C:conf([postgres, vault_token_path], YamlConfig, undefined))}
),
add_optional(
WithOptional,
{vault_role, to_string(?C:conf([postgres, vault_role], YamlConfig, undefined))}
).

add_optional(Conf, {_Key, undefined}) ->
Conf;
add_optional(Conf, Pair) ->
[Pair | Conf].

pg_databases(YamlConfig) ->
lists:foldl(
Expand Down Expand Up @@ -799,3 +812,8 @@ log_level_tuple_to_atom({<<"debug">>, NewLevel}) when is_binary(NewLevel) ->
{debug, binary_to_atom(NewLevel)};
log_level_tuple_to_atom({Level, _NewLevel}) ->
throw("Not supported logger level '" ++ binary_to_list(Level) ++ "'").

to_string(undefined) ->
undefined;
to_string(V) when is_binary(V) ->
unicode:characters_to_list(V).
Loading