Skip to content

Fix --env-file support for the gateway#2085

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:fix-env-file-gateway
Mar 12, 2026
Merged

Fix --env-file support for the gateway#2085
dgageot merged 1 commit intodocker:mainfrom
dgageot:fix-env-file-gateway

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Mar 12, 2026

No description provided.

Signed-off-by: David Gageot <david.gageot@docker.com>
@dgageot dgageot requested a review from a team as a code owner March 12, 2026 13:58
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Assessment: 🟢 APPROVE

Summary

This PR correctly implements --env-file support for gateway configuration by replacing os.Getenv() calls with env.Get(ctx, ...) from the environment provider chain. The change enables reading environment variables from files specified via --env-file while maintaining the existing precedence order.

Analysis:

  • All four env.Get() calls correctly ignore the bool return value (which indicates "found" vs "not found")
  • The code properly checks for non-empty values (gateway != "", model != "") to determine whether to use the configuration
  • I/O errors from reading env files are already handled upstream in computedEnvProvider() before Get() is called
  • This pattern matches standard Go conventions and is consistent with the codebase's environment package

Verdict: No issues found. The implementation is correct and follows established patterns in the codebase.


Automated review by docker-agent PR reviewer

@dgageot dgageot merged commit d722f18 into docker:main Mar 12, 2026
8 checks passed
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.

2 participants