Commit Graph

18 Commits

Author SHA1 Message Date
Preetha Appan
829bf74aa8 modify fingerprint interface to use typed attribute struct 2018-11-28 10:01:03 -06:00
Michael Schurter
43b359914b client: interpolate driver configurations
Also add missing SetDriverNetwork calls.
2018-11-15 16:25:57 -08:00
Mahmood Ali
851b275afc Merge pull request #4858 from hashicorp/b-fix-master-20181109
Fix some tests in master
2018-11-13 16:08:26 -05:00
Mahmood Ali
9d6a362b94 Use materialized duration fields for driver config 2018-11-13 10:21:40 -05:00
Mahmood Ali
416b5240f4 Handle time.Duration in mock
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.
2018-11-13 10:21:40 -05:00
Alex Dadgar
9d42f4d039 Plugin client's handle plugin dying
This PR plumbs the plugins done ctx through the base and driver plugin
clients (device already had it). Further, it adds generic handling of
gRPC stream errors.
2018-11-12 17:09:27 -08:00
Michael Schurter
fdbe446ea6 client: first pass at implementing task restoring
Task restoring works but dead tasks may be restarted
2018-11-05 12:32:05 -08:00
Michael Schurter
e949416e12 drivers/mock: standardize names/code 2018-10-31 11:52:51 -07:00
Michael Schurter
55d79c6022 mock_driver: match other's fingerprint message 2018-10-30 17:38:23 -07:00
Michael Schurter
9fb39b35c6 drivers: remove stutter from exported driver names
Also fix a comment on the logger that got copy/pasted around.
2018-10-30 14:05:31 -07:00
Nick Ethier
da7563b8c3 Merge pull request #4795 from hashicorp/f-plugin-config
Pass client configuration to plugins through loader
2018-10-29 18:42:27 -07:00
Nick Ethier
95d381cff7 rename NomadConfig to ClientAgentConfig 2018-10-29 21:34:34 -04:00
Nick Ethier
3244a4cc57 plumb NomadConfig into plugins 2018-10-16 22:47:22 -04:00
Alex Dadgar
a10d3964d0 Do not use cty in drivers 2018-10-16 17:17:07 -07:00
Michael Schurter
9c4a1d4c28 drivers/mock: fix plugin name
Was mock_driver before plugins, so keep the name.
2018-10-16 16:56:56 -07:00
Michael Schurter
4175e908dd fixup comments, logging, and missing method impls
from #4777 comments
2018-10-16 16:56:56 -07:00
Michael Schurter
089bce5ab4 drivers/mock: complete plugin impl 2018-10-16 16:56:56 -07:00
Nick Ethier
9bd696e2de drivers/mock: start mock driver implementation 2018-10-16 16:56:56 -07:00