-
Notifications
You must be signed in to change notification settings - Fork 107
flag.Duration and flag.DurationVar parse errors not handled properly #944
Comments
incorrect. though the api is kindof weird. |
I think the simplest and clearest approach is to just use stringvars everywhere and do an explicit parse step where we can easily check the error and fatal out if needed |
I guess now that it's merged we can just reuse |
while we're at it: #485 (comment) |
I did same '30d' mistake too, maybe it should be mentioned in example config? |
Or let me know how can I help with fixing that issue ( I mean which exact help is wanted) |
Change flag.Duration and flag.DurationVar to flag.StringVar for parsing Add config.go to cassandra idx to align with cassandra store Add variables to cassandra idx to avoid indirection in calls to config Update docs and metrictank example configs to reflect changes Duration configuration settings in cassandra idx will now accept the following time units: s/sec/secs/second/seconds, m/min/mins/minute/minutes, h/hour/hours, d/day/days, w/week/weeks, mon/month/months, y/year/years First step in implementing flag.StringVar throughout all of metrictank to allow easier parsing and control See also: #944
add ability to implement custom validation for config values in cass idx add config.go for cass idx configuration update cass idx tests to use new config update metrictank config and docs to show valid time units update mt-index-cat to use new cass idx config update mt-whisper-importer-writer to use new cass idx config See also: #944
add ability to implement custom validation for config values in cass idx add config.go for cass idx configuration update cass idx tests to use new config update metrictank config and docs to show valid time units update mt-index-cat to use new cass idx config update mt-whisper-importer-writer to use new cass idx config See also: #944
add ability to implement custom validation for config values in cass idx add config.go for cass idx configuration update cass idx tests to use new config update metrictank config and docs to show valid time units update mt-index-cat to use new cass idx config update mt-whisper-importer-writer to use new cass idx config See also: #944
fixed by #1141 |
from a customer
flag.Duration and flag.DurationVar have no way to validate input, they just return 0
in some of these flags 0 is a valid input value, so in those cases we should use another input type..
where we do use the flag.Duration* types, we should validate that they are !=0
maybe for consistency we should use our own parsing everywhere
The text was updated successfully, but these errors were encountered: