Skip to content

-config.expand-env requires argument #3082

@carlpett

Description

@carlpett

If not provided an argument, -config.expand-env fails parsing/validation and causes an exit. Easily reproducible with ./cortex -config.expand-env.
The working usage seems to be -config.expand-env=true.

While the documentation isn't completely clear on the topic, my reading is at least that -config.expand-env does not require any argument:

You can use environment variable references in the config file to set values that need to be configurable during deployment by using the `-config.expand-env` flag.

The various unit tests in main_test.go seem to get around this somehow?

As a side-note, passing non-boolean arguments is silently accepted as false, for example -config.expand-env=FOO would not lead to ${FOO} being expanded, but kept verbatim in the file. I tested that variety since I've used other systems in the past where a list of allowed environment variables needs to be passed, not sure if that would be a common reasoning.

Metadata

Metadata

Assignees

No one assigned

    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