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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant