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

Reorder config loading so it doesn't merge values inappropriately #185

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

danny6167
Copy link
Member

This PR changes the order of operations when loading the config.yml

Currently when wings starts up, it starts with an empty Configuration struct that is then filled with the defaults and THEN we overlay the data from the config.yml using yaml.Unmarshal(). This overwrites any values in the struct with any values that exist in the config.yml

The issue is when encountering an array/list/map yaml.Unmarshal() will merge the values from the config.yml with the defaults. Such as shown in pterodactyl/panel#5008

By changing the order so that defaults.Set() is called after the struct has been filled with the data from config.yml, only missing keys will be filled

This would resolve pterodactyl/panel#5008

@danny6167
Copy link
Member Author

Submitted as a draft while I wait for a couple of people to test it.

@danny6167 danny6167 marked this pull request as ready for review July 15, 2024 09:40
@danny6167 danny6167 requested a review from matthewpi July 25, 2024 06:07
@danny6167
Copy link
Member Author

Had a few people try this and report positive results.
No reports of unintended consequences and I'm using this myself in prod.

@Luiggi33
Copy link

Seeing this implement would really help when trying to add solutions like Grafana Loki as a logging db. I can attest that this broke nothing on my test setup and am looking forward to this being merged

@matthewpi matthewpi merged commit 708cdd0 into pterodactyl:develop Aug 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🧨 Awaiting release
Development

Successfully merging this pull request may close these issues.

fluentd as Docker log driver for Wings
3 participants