-
Notifications
You must be signed in to change notification settings - Fork 2k
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
The configured key is in uppercase and is converted to lowercase #411
Comments
Nobody cares 😭 |
This change makes `apm_config.analyzed_rate_by_service` and `apm_config.analyzed_spans` entries case insensitive. The reasoning behind this is that Viper always lower-cases keys in the yaml file, make it impossible to compare against the orginal value. See spf13/viper#411.
This change makes `apm_config.analyzed_rate_by_service` and `apm_config.analyzed_spans` entries case insensitive. The reasoning behind this is that Viper always lower-cases keys in the yaml file, make it impossible to compare against the orginal value. See spf13/viper#411.
…3113) * pkg/trace/event: make event service & operation matchin insensitive This change makes `apm_config.analyzed_rate_by_service` and `apm_config.analyzed_spans` entries case insensitive. The reasoning behind this is that Viper always lower-cases keys in the yaml file, make it impossible to compare against the orginal value. See spf13/viper#411.
…3113) * pkg/trace/event: make event service & operation matchin insensitive This change makes `apm_config.analyzed_rate_by_service` and `apm_config.analyzed_spans` entries case insensitive. The reasoning behind this is that Viper always lower-cases keys in the yaml file, make it impossible to compare against the orginal value. See spf13/viper#411.
I just discovered this behaviour and I find it very annoying and somewhat weird. Part of my yaml configuration file is a map of key-values that I want to check against:
I expect to get the values of the yaml sub-tree testing.variables as a map and it seems that I can do it with viper.GetStringMapString("testing.variables") however, since it sets them to lowercase I receive an unexpected set of variables. I would say that GetStringMapString should retain the same keys as it finds because if not the configuration file that I'm reading with viper is not at all the configuration file I have in disk. |
Viper is case-insensitive by default, because this is the way it can match flags, env vars and file keys. Consider the following: you want testing:
variables:
myVar1: val1
myvar1: val1
mYvar1: val2 Ultimately config is supposed to be accessed directly by I've recently hit the same wall as well. I can't really promise anything on this front, except that I will work on it and try to find a solution. PRs and help is always welcome, although in this case I hardly think a PR would be accepted as is 🙂 |
Viper has a feature/bug where all YAML config keys are cast to lowercase (see spf13/viper#260 and spf13/viper#411). Since we use Viper to load our config values, it doesn't seem like there's an easy way to preserve case sensitivity for the access names chosen by users right now. Adding this prompt should help user experience by clarifying that all access names must be lowercase. Change-Id: I47e8344bb0ca7e78458405496f20e78e3c9f9a88
spf13/viper#411 fixes an issue where contexts created with uppercase characters cannot later be modified.
Duplicate of #1014 |
The configured key is in uppercase and is converted to lowercase
E.g:
If you pass the following test is normal,
If the following way to directly access the map, found in the map key all converted to lowercase
BCfg = viper.GetStringMapString ("greenSDK")
the value is :
The text was updated successfully, but these errors were encountered: