git.iko.soy/typeable/oauth2-proxy
on master help sign in
apply review suggestions

Signed-off-by: Jan Larwig <jan@larwig.com>

commit676f56a35e135ef304e6cff6886e59cd2151baa0 authorJan Larwig <jan@larwig.com> dateSat 1 Feb 2025, 15:57 (2 years ago) parent7c20001
2 files changed+3−4
main.go+1−1 pkg/apis/options/load.go+2−3
main.go+1−1
@@ -70,7 +70,7 @@ func main() {
7070func loadConfiguration(config, yamlConfig string, extraFlags *pflag.FlagSet, args []string) (*options.Options, error) {
7171 opts, err := loadLegacyOptions(config, extraFlags, args)
7272 if err != nil {
73− return nil, err
73+ return nil, fmt.Errorf("couldn't load legacy options: %w", err)
7474 }
7575
7676 if yamlConfig != "" {
pkg/apis/options/load.go+2−3
@@ -83,12 +83,11 @@ func Decode(input interface{}, result interface{}) error {
8383 DecodeHook: mapstructure.ComposeDecodeHookFunc(toDurationHookFunc()),
8484 Metadata: nil, // Don't track any metadata
8585 Result: result, // Decode the result into the prefilled options
86− TagName: "json", // Parse all fields that use the yaml tag
86+ TagName: "json", // Parse all fields that use the json tag
8787 ZeroFields: false, // Don't clean the default values from the result map (options)
8888 ErrorUnused: true, // Throw an error if keys have been used that aren't mapped to any struct fields
89− IgnoreUntaggedFields: true, // Ignore fields in structures that aren't tagged with yaml
89+ IgnoreUntaggedFields: true, // Ignore fields in structures that aren't tagged with json
9090 })
91−
9291 if err != nil {
9392 return fmt.Errorf("error creating decoder for config: %w", err)
9493 }