Skip to content

introduce ability to use custom env_file format#690

Merged
ndeloof merged 1 commit into
compose-spec:mainfrom
ndeloof:env_format
Oct 7, 2024
Merged

introduce ability to use custom env_file format#690
ndeloof merged 1 commit into
compose-spec:mainfrom
ndeloof:env_format

Conversation

@ndeloof
Copy link
Copy Markdown
Collaborator

@ndeloof ndeloof commented Oct 1, 2024

This allows to register additional env_file format parser, so one can plug https://github.com/docker/cli/blob/master/opts/envfile.go as an alternate parser, to support reading "raw" env_file just like docker run --env-file does.

@ndeloof ndeloof force-pushed the env_format branch 5 times, most recently from 36e1834 to 2d728e7 Compare October 2, 2024 06:55
@ndeloof ndeloof force-pushed the env_format branch 4 times, most recently from cdb140d to 2e66a7c Compare October 2, 2024 14:34
Copy link
Copy Markdown
Collaborator

@jhrotko jhrotko left a comment

Choose a reason for hiding this comment

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

LGTM! I would also add/change a test in loader to also cover this case

Comment thread types/project.go Outdated
fileVars, err = dotenv.ParseWithLookup(file, resolve)
}
if err != nil {
return nil, nil
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return nil, nil
return nil, err

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

indeed 😓

@ndeloof
Copy link
Copy Markdown
Collaborator Author

ndeloof commented Oct 2, 2024

@jhrotko a test in loader would make sense if we had an actual alternate format implementation hosted in this repo, but here we just define an extension point. raw loader test is here

Copy link
Copy Markdown
Collaborator

@jhrotko jhrotko left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Collaborator

@glours glours left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof enabled auto-merge (rebase) October 7, 2024 07:14
@ndeloof ndeloof merged commit 49efa50 into compose-spec:main Oct 7, 2024
@ndeloof ndeloof deleted the env_format branch October 7, 2024 07:24
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.

3 participants