Skip to content

Config fields defined as slices cannot have commas in item values #1404

Closed
@hypnoglow

Description

Describe the bug

As an example, there is ATHENS_GO_BINARY_ENV_VARS environment variable. When parsing, envconfig splits on comma. Thus, if I want to pass GOPRIVATE=*.corp.example.com,rsc.io/private - this won't work, because value contains comma, which basically results into two wars GOPRIVATE=*.corp.example.com and rsc.io/private=.

Expected behavior

I expect to be able to assign env vars which values can contain commas to Athens config fields like ATHENS_GO_BINARY_ENV_VARS.

Additional context

I guess we might consider providing alternate separator like ;. This way we can pass ATHENS_GO_BINARY_ENV_VARS=GOPRIVATE=*.corp.example.com,rsc.io/private;GOPROXY=direct and this will expand properly into GOPRIVATE=*.corp.example.com,rsc.io/private and GOPROXY=direct. But this also implies that separator ; cannot be used in a value.

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