Giter Club home page Giter Club logo

Comments (3)

kevgliss avatar kevgliss commented on August 27, 2024

Interesting. We typically only use .env files for configuration show we haven't come across this issue. Under the hood we just use starlette config, which does read from the envvars but perhaps not in this context?

https://www.starlette.io/config/

from dispatch.

tsekine354 avatar tsekine354 commented on August 27, 2024

When dispatch is brought up via docker-compose, .env environment file is parsed by docker-compose
https://github.com/Netflix/dispatch-docker/blob/master/docker-compose.yml#L24
then those variables are given to each docker container as environment variables.

Those environment variables are stored in config.environ
https://github.com/encode/starlette/blob/master/starlette/config.py#L55
while .env file parsed by dispatch (or its underlying starlette) are stored in config.file_values.

You use only latter one, so show_config() is implemented to support that case only.

But that's not the main point. Regardless how .env contents are given to dispatch, my feature request is to show parsed config, not to show what are given.

One of typical use case is to detect typo in variable name. If I made a typo in variable name but it has default value (or, the variable is referenced by config(..., default=...)), I expect to see the default value on show_config(), so that I could find that there are some problems in config. Current code displays just the typo as-is, then I'll observe unexpected behavior, then I'm supposed to dig deeper to see if it's bug of program or misconfiguration of program.

from dispatch.

kevgliss avatar kevgliss commented on August 27, 2024

I've put together #264... I think it's kind of hacky but it's not terrible. Please let me know if that satisfies your use case.

from dispatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.