Conversation
rolodato
left a comment
There was a problem hiding this comment.
The error is not about unknown environment variables, it only happens if you try to use defined aliases
edge-proxy/src/edge_proxy/settings.py
Lines 119 to 121 in 6cde1e8
|
|
||
| class AppConfig(AppSettings, BaseSettings): | ||
| class Meta: | ||
| extra = "ignore" |
There was a problem hiding this comment.
This is already the default per https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.extra
There was a problem hiding this comment.
Hmm... yes, but it's overridden specifically in the BaseSettings class as per this.
That being said, I expected (based on this) that something like docker run --rm -e FOO_BAR=foo flagsmith/edge-proxy:2.17.0 would also generate the error, but it didn't.
Probably more investigation is needed, although the solution I added here does prevent the error reported in the issue when using API_POLL_FREQUENCY, but perhaps it also has some other knock on effects that need investigating before (if) we merge this.
There was a problem hiding this comment.
I have tested the behaviour and verified that the code here does resolve the issue - it prevents the exception as well as behaving as expected if you to set API_POLL_FREQUENCY environment variable (or any other aliased name of a given setting).
I think we should go ahead and merge this.
376f357 to
92a2142
Compare
Related to this issue.
The purpose is to prevent the application from hard crashing when unrecognised environment variables are provided.