-
Notifications
You must be signed in to change notification settings - Fork 618
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
feat: conforming envfile parsing to docker compose envfile #3763
Conversation
This pr is made for this issue #3429 |
Thanks for the contribution! Several comments
|
Let me know if its okay to import the total docker-compose package just for the functionality of dotenv implementation. |
Yep please import the whole package so we can have dependabot to help maintain it. |
Hi @Realmonia, whenever I try |
Hmm interesting. It does not make sense to me as those packages are not part of the dependency in go.mod of the compose-go package. Can you try if handle override of these dependencies to previous version would work? If not, maybe you can try this godotenv dependency https://github.com/joho/godotenv |
Even without the dependency, If I try to run the commands - github.com/docker/docker v20.10.24+incompatible
+ github.com/docker/docker v24.0.2+incompatible
github.com/docker/go-connections v0.4.0
- github.com/docker/go-units v0.4.0
+ github.com/docker/go-units v0.5.0 Looks like it was an issue with ecs-agent which was fixed recently in a different pr |
Oh yeah I forgot that. That makes sense. Can you add an unit test to test the env file parsing behavior when it contains escape? |
1. multiple cases of shell escaping 2. json sample unquoted test 3. support for values that span multiple lines
Just for your information, these new changes will break the existing spec of task-def Example exisitng envfile that is working currently but will produce a completely different output with the above changes:
output produced by old code: output produced by new parsing:
|
Hey sorry after further discussion with the team, we decide to not make this change for now. As you pointed out this conflicts with the current documentation; we will need our product team to be involved in, and have proper customer wording before we actually make such change. However, it's possible that we will do this in the future, and we will reopen & merge PR then. Thanks again for the contribution and sorry again for the confusion! |
Summary
This pull request aims to support escape characters and support docker-compose spec (Doesn't support Parameter expansion)
Implementation details
I have imported the files from docker compose reporsitory and used those files to parse the envfiles
Testing
New tests cover the changes:
yes
Description for the changelog
Feature: Envfile conforming to docker-compose envfile (Not including parameter expansion)
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.