mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Mock driver config uses `time.Duration` fields but we initialize them inconsistently, as time.Duration sometimes and as duration strings other times. Previously, `mapstructure` handles it and does the right thing. This is no longer the case with MsgPack. I could not find a good way to bring back old behavior without too much complexity. `MsgPack` extended types weren't ideal here as we lose type information (e.g. int64 vs string), and the input is a generic map and not a MsgPack serialization of duration. As such, I went with the simple solution of declaring the config field as duration string, and panicing if the test doesn't pass a valid string. I found this to cause the smallest change in tests, but we can alternatively force all to be int64 instead.
2.9 KiB
2.9 KiB