Skip to content

Commit

Permalink
Revert "Fix: Force usage of case-sensitive keys in configurations (#6876
Browse files Browse the repository at this point in the history
)" (#6988)

This reverts commit 8fa8408.
  • Loading branch information
bogdandrutu authored Jan 23, 2023
1 parent 51c9139 commit 80cabdd
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 30 deletions.
16 changes: 0 additions & 16 deletions .chloggen/case-sensitive-configuration.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions confmap/confmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ func decodeConfig(m *Conf, result interface{}, errorUnused bool) error {
Result: result,
TagName: "mapstructure",
WeaklyTypedInput: true,
MatchName: caseSensitiveMatchName,
DecodeHook: mapstructure.ComposeDecodeHookFunc(
expandNilStructPointersHookFunc(),
mapstructure.StringToSliceHookFunc(","),
Expand Down Expand Up @@ -190,13 +189,6 @@ func encoderConfig(rawVal interface{}) *encoder.EncoderConfig {
}
}

// case-sensitive version of the callback to be used in the MatchName property
// of the DecoderConfig. The default for MatchEqual is to use strings.EqualFold,
// which is case-insensitive.
func caseSensitiveMatchName(a, b string) bool {
return a == b
}

// In cases where a config has a mapping of something to a struct pointers
// we want nil values to resolve to a pointer to the zero value of the
// underlying struct just as we want nil values of a mapping of something
Expand Down
4 changes: 0 additions & 4 deletions exporter/loggingexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ func TestUnmarshalConfig(t *testing.T) {
filename: "invalid_verbosity_loglevel.yaml",
expectedErr: "'loglevel' and 'verbosity' are incompatible. Use only 'verbosity' instead",
},
{
filename: "config_loglevel_typo.yaml",
expectedErr: "1 error(s) decoding:\n\n* '' has invalid keys: logLevel",
},
}

for _, tt := range tests {
Expand Down
2 changes: 0 additions & 2 deletions exporter/loggingexporter/testdata/config_loglevel_typo.yaml

This file was deleted.

0 comments on commit 80cabdd

Please sign in to comment.