open-nomad/client/allocrunner
Tim Gross aa8927abb4
volumes: return better error messages for unsupported task drivers (#8030)
When an allocation runs for a task driver that can't support volume mounts,
the mounting will fail in a way that can be hard to understand. With host
volumes this usually means failing silently, whereas with CSI the operator
gets inscrutable internals exposed in the `nomad alloc status`.

This changeset adds a MountConfig field to the task driver Capabilities
response. We validate this when the `csi_hook` or `volume_hook` fires and
return a user-friendly error.

Note that we don't currently have a way to get driver capabilities up to the
server, except through attributes. Validating this when the user initially
submits the jobspec would be even better than what we're doing here (and could
be useful for all our other capabilities), but that's out of scope for this
changeset.

Also note that the MountConfig enum starts with "supports all" in order to
support community plugins in a backwards compatible way, rather than cutting
them off from volume mounting unexpectedly.
2020-05-21 09:18:02 -04:00
..
interfaces
state
taskrunner volumes: return better error messages for unsupported task drivers (#8030) 2020-05-21 09:18:02 -04:00
alloc_runner.go allocrunner: Push state from hooks to taskrunners 2020-03-23 13:58:30 -04:00
alloc_runner_hooks.go volumes: return better error messages for unsupported task drivers (#8030) 2020-05-21 09:18:02 -04:00
alloc_runner_test.go tests: update AR task restart policy 2020-03-24 17:00:42 -04:00
alloc_runner_unix_test.go tests: restart restartpolicy for all tasks in tests 2020-03-24 21:52:48 -04:00
allocdir_hook.go
config.go client: Pass an RPC Client to AllocRunners 2020-03-23 13:58:30 -04:00
consulsock_hook.go
consulsock_hook_test.go
csi_hook.go volumes: return better error messages for unsupported task drivers (#8030) 2020-05-21 09:18:02 -04:00
groupservice_hook.go ensure shutdown delay can be removed 2020-04-06 11:33:04 -04:00
groupservice_hook_test.go ensure shutdown delay can be removed 2020-04-06 11:33:04 -04:00
health_hook.go
health_hook_test.go health: fail health if any task is pending 2020-03-22 11:13:41 -04:00
migrate_hook.go
network_hook.go
network_hook_test.go
network_manager_linux.go
network_manager_linux_test.go
network_manager_nonlinux.go
networking.go
networking_bridge_linux.go ar/bridge: use cni.IsCNINotInitialized helper 2020-04-06 21:44:01 -04:00
task_hook_coordinator.go address review feedback 2020-03-21 17:52:58 -04:00
task_hook_coordinator_test.go refactor TaskHookCoordinator tests to use mock package and add failed init and sidecar test cases 2020-03-21 17:52:56 -04:00
testing.go
upstream_allocs_hook.go
util.go