Skip to content

otava.yml template variables make optional parameters defacto required #82

@henrikingo

Description

@henrikingo

Note that this is a generalisation of #65 .

If a user, particularly a new user, has not created a configuration file for otava, they will default to reading the one supplied in otava/resources/otava.yml.

That file uses some kind of template variables (jinja2?), such as ${GRAFANA_ADDRESS}. This allows the user to define these values as environment variables and have them interpolated into the yaml file eventually. However, this has the unintended consequence that all of the variables in this default yaml file are now required.

Workaround : Just supply dummy values in the corresponding environment variables. Or, create your own otava.yaml file with minimal configuration. In that case the default file will never be read and this problem is avoided. (This is the common path.)

Proposed solution: IMO mixing environment variables into the yaml file configuration is the problem here. The correct way to support environment variables in my opinion is to read them and the yaml options separately, then merge them in some well defined priority order.

My personal preference would be to user ConfigArgParse and support all options in the same library. (CLI options, yaml file,

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions