fix: missing tags on target manager config field #109
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.
Motivation
The implementation of #101 introduced a bug with its embedded
Config
struct to theTargetManagerConfig
.Viper or rather the underlying library mapstructure doesn't unmarshal the embedded fields of the
Config
struct directly in theTargetManagerConfig
struct. It rather uses the internal struct key of it. So the mapstructure library sees the struct like this:That means that the startup config currently needs a
Config
key as part of thetargetManager
key which has the general configuration options for thetargetManager
. So an example configuration currently needs to look like this:Reference
spf13/viper#797
https://pkg.go.dev/github.com/mitchellh/mapstructure#hdr-Embedded_Structs_and_Squashing
Changes
I've added the missing yaml and mapstructure tags for the embedded struct.
Now the configuration can again look like this:
For additional information look at the commits.
Tests done
Manual e2e tests
I've added a debug log after unmarshaling the startup config into its config struct:
TODO