-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config fields defined as slices cannot have commas in item values #1404
Comments
@hypnoglow sorry for the delay. I like what you did in gomods/athens-charts#22, but I think we should support both. Instead of using ~/src/gomods/athens(fill-cache) » export GOPRIVATE="[*.corp.example.com,rsc.io/private]"
~/src/gomods/athens(fill-cache) » echo $GOPRIVATE
[*.corp.example.com,rsc.io/private] |
If I understood you correctly, you want to provide non-compatible format for standard envs like |
Hi We're having the same issue. Our scenario is that our company has private repositories in many different places, as an example imagine the following list:
Now Imagine that we want to set up athens proxy in front of all those repositories, we'd have to define something like:
Unfortunately this is not possible because of the problem explained in the description of the ticket. As a result I can only set GOPRIVATE to one of the sites potentially leaking information about my private repositories in the other sites. Hope this clarifies a bit the issue. Regards! |
(this popped up in my subscription to codeTriage so thought I'd take a peek) I reviewed #1505 and think its the wrong approach - You're just kicking problem down the road to the next person who needs Also, what if I want an The only scalable approach is to parse the string sequentially and have one or more supported quote/escape patterns. Scan for first occurrence of In its most-simple form, you could allow for the escaping of the desired pair-separator within the VALUE. In this instance it would mean using Personally, I think the right answer is:
A It seems very likely that there are already parsers for these types of strings (although I didn't research it). Happy to discuss more - Thank you for your time reading my drive-by opinion :) -DF |
@davidpfarrell Valid points. But, personally, I cannot imagine that someone needs
Sure, there might be some rare use cases, but we should decide if we want additional complexity to support custom separators or just go with default separator hoping that it will suffice for almost all users. |
You realize @ kelseyhightower likely said those exact same words when he decided on the use of As an aside, one thing I didn't realize is that Athens treats this parsed value as an I also realize that changing the So if we're okay with a breaking change, then I suppose But if it turns out we are NOT okay with breaking changes, then my updated recommendation would likely be: Walk the string sequentially, splitting slice entries on Supporting the NOTE: It does occur to me that we may need to also support [edit] spelling, grammar |
I think in this particular case it's okay to introduce a breaking change for a couple of reasons:
I like the idea of
And yes, I'm sure there might some rare cases where you need If there are any objections to this please let me know. For those who are running into this issue, know that you already have a couple of work arounds:
I'll try to get the fix merged and released as soon as possible since it's a bit of an important bug. Thanks everyone! |
Amazing! @marwan-at-work thank you for the great work! |
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 passGOPRIVATE=*.corp.example.com,rsc.io/private
- this won't work, because value contains comma, which basically results into two warsGOPRIVATE=*.corp.example.com
andrsc.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 passATHENS_GO_BINARY_ENV_VARS=GOPRIVATE=*.corp.example.com,rsc.io/private;GOPROXY=direct
and this will expand properly intoGOPRIVATE=*.corp.example.com,rsc.io/private
andGOPROXY=direct
. But this also implies that separator;
cannot be used in a value.The text was updated successfully, but these errors were encountered: