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

env: fix path resolution with extends #351

Merged
merged 2 commits into from
Feb 15, 2023
Merged

Conversation

milas
Copy link
Member

@milas milas commented Feb 15, 2023

  • Fix an issue with WithEnvFile helper to not pass empty values
  • Rewrite env_file paths from extends file to be relative to the included file rather than parent (this was a regression)
  • Normalize extends.file path to be absolute when doing the same for other paths

See docker/compose#10258.

@milas milas added the bug Something isn't working label Feb 15, 2023
@milas milas self-assigned this Feb 15, 2023
* Fix an issue with `WithEnvFile` helper to not pass empty values
* Rewrite `env_file` paths from `extends` file to be relative to
  the included file rather than parent (this was a regression)
* Normalize `extends.file` path to be absolute when doing the same
  for other paths

See docker/compose#10258.

Signed-off-by: Milas Bowman <[email protected]>
@@ -190,7 +190,11 @@ func WithOsEnv(o *ProjectOptions) error {
// WithEnvFile set an alternate env file
// deprecated - use WithEnvFiles
func WithEnvFile(file string) ProjectOptionsFn {
return WithEnvFiles(file)
var files []string
if file != "" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

LGTM from a backward compatibility point of view, but we should also update compose to pass []string, see https://github.com/docker/compose/pull/10284/files#diff-2922e5cbd75acccf0c12784852f77f143247e72a57719e883225f10f960acd40L132-R232

@ndeloof ndeloof merged commit 9936908 into compose-spec:master Feb 15, 2023
@milas milas deleted the env-extends branch February 15, 2023 20:08
@milas milas restored the env-extends branch February 15, 2023 20:08
@milas milas deleted the env-extends branch February 15, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants