Skip to content
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

allow '.' (dot) in environment variable name #271

Merged
merged 1 commit into from Jun 22, 2022

Conversation

glours
Copy link
Contributor

@glours glours commented Jun 2, 2022

@glours glours requested a review from ulyssessouza Jun 2, 2022
@glours glours self-assigned this Jun 2, 2022
@glours glours requested a review from ndeloof as a code owner Jun 2, 2022
milas
milas approved these changes Jun 7, 2022
Copy link
Member

@milas milas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic LGTM for the compat fix!

Thoughts on larger impact around Compose spec:

My understanding is that there's 2 accepted "specs" for environment variable names out there:

  • IEEE Std 1003.1-2001 - any printable character but = and NUL is valid
  • Most shells - alphanumeric + _, must start with letter -> [a-zA-Z_][a-zA-Z0-9_]*

Given that v1 allowed ., I'm guessing for the Compose spec, we want to formalize supporting the more flexible option, at which point, we should revisit the impl here to match since right now this is somewhere in the middle -- it's almost the shell rules but we don't require first char to be a letter and now we'll allow .

dotenv/parser.go Outdated Show resolved Hide resolved
loader/example1.env Show resolved Hide resolved
loader/full-struct_test.go Outdated Show resolved Hide resolved
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker-compose doesn't accept environment variables with dot symbol (".")
3 participants