Skip to content

When called from distillery as a provider, config isn't actually merged an instead is overrwritten for any app in the TOML config. #26

@idyll

Description

@idyll

When called from distillery as a provider, config isn't actually merged and instead is overrwritten for any app in the TOML config.

It's unclear to me if we should be solving this here or at the Distillery level, however other config providers appear to solve it internally...

The issue is that persist tries to merge the incoming config, but with Distillery the incoming config is always empty.

    defp persist(config, keyword) when is_list(keyword) do
      config = Config.Reader.merge(config, keyword)
      Application.put_all_env(config, persistent: true)
      config
    end

In persist config is always [] when called from Distillery because load is called as:

    if is_distillery_env?() do
      # When running under Distillery, init performs load
      load([], opts)
      opts
    else

Because of this we end up with any existing config being overwritten on an application level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions