Don't cache the node config in the CfgVars struct #5433
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The node config should be read at most once and then reused. Caching the config in this way shouldn't be necessary.
On the way:
LoadRuntimeConfig
. This is the only information needed. Passing just the path insteadof the full
CfgVars
struct makes it easier to reason about what is happening.vars
variable andDeepCopy
. Thevars
variable was never read, and theDeepCopy
method was used just to initialize it. Remove both. The original intent was probably not to list theStartupConfigPath
in the file written to disk, but since that never worked as intended and there were no problems with it, I think it's okay to leave things as they are.NewRuntimeConfig
test. Use a real config file instead of mocking out the config file loadingusing the private
nodeConfig
field. Verify that the folder for the runtime config file is created, if it doesn't exist.Type of change
How Has This Been Tested?
Checklist: