open-nomad/client/allocrunner
Lang Martin e100444740 csi: add mount_options to volumes and volume requests (#7398)
Add mount_options to both the volume definition on registration and to the volume block in the group where the volume is requested. If both are specified, the options provided in the request replace the options defined in the volume. They get passed to the NodePublishVolume, which causes the node plugin to actually mount the volume on the host.

Individual tasks just mount bind into the host mounted volume (unchanged behavior). An operator can mount the same volume with different options by specifying it twice in the group context.

closes #7007

* nomad/structs/volumes: add MountOptions to volume request

* jobspec/test-fixtures/basic.hcl: add mount_options to volume block

* jobspec/parse_test: add expected MountOptions

* api/tasks: add mount_options

* jobspec/parse_group: use hcl decode not mapstructure, mount_options

* client/allocrunner/csi_hook: pass MountOptions through

client/allocrunner/csi_hook: add a VolumeMountOptions

client/allocrunner/csi_hook: drop Options

client/allocrunner/csi_hook: use the structs options

* client/pluginmanager/csimanager/interface: UsageOptions.MountOptions

* client/pluginmanager/csimanager/volume: pass MountOptions in capabilities

* plugins/csi/plugin: remove todo 7007 comment

* nomad/structs/csi: MountOptions

* api/csi: add options to the api for parsing, match structs

* plugins/csi/plugin: move VolumeMountOptions to structs

* api/csi: use specific type for mount_options

* client/allocrunner/csi_hook: merge MountOptions here

* rename CSIOptions to CSIMountOptions

* client/allocrunner/csi_hook

* client/pluginmanager/csimanager/volume

* nomad/structs/csi

* plugins/csi/fake/client: add PrevVolumeCapability

* plugins/csi/plugin

* client/pluginmanager/csimanager/volume_test: remove debugging

* client/pluginmanager/csimanager/volume: fix odd merging logic

* api: rename CSIOptions -> CSIMountOptions

* nomad/csi_endpoint: remove a 7007 comment

* command/alloc_status: show mount options in the volume list

* nomad/structs/csi: include MountOptions in the volume stub

* api/csi: add MountOptions to stub

* command/volume_status_csi: clean up csiVolMountOption, add it

* command/alloc_status: csiVolMountOption lives in volume_csi_status

* command/node_status: display mount flags

* nomad/structs/volumes: npe

* plugins/csi/plugin: npe in ToCSIRepresentation

* jobspec/parse_test: expand volume parse test cases

* command/agent/job_endpoint: ApiTgToStructsTG needs MountOptions

* command/volume_status_csi: copy paste error

* jobspec/test-fixtures/basic: hclfmt

* command/volume_status_csi: clean up csiVolMountOption
2020-03-23 13:59:25 -04:00
..
interfaces allow only positive shutdown delay 2019-12-16 11:38:30 -05:00
state stale allocation data leads to incorrect (and even negative) metrics (#5637) 2019-05-07 15:54:36 -04:00
taskrunner csi: dynamically update plugin registration (#7386) 2020-03-23 13:59:25 -04:00
alloc_runner.go allocrunner: Push state from hooks to taskrunners 2020-03-23 13:58:30 -04:00
alloc_runner_hooks.go hook resources: Init with empty resources during setup 2020-03-23 13:58:30 -04:00
alloc_runner_test.go remove debugging test code from TestAllocRunner_TaskLeader_StopRestoredTG 2020-03-21 17:52:54 -04:00
alloc_runner_unix_test.go client: improve group service stanza interpolation and check_re… (#6586) 2019-11-18 13:04:01 -05:00
allocdir_hook.go client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
config.go client: Pass an RPC Client to AllocRunners 2020-03-23 13:58:30 -04:00
consulsock_hook.go connect: remove proxy socket for restarted client 2019-09-25 14:58:17 -04:00
consulsock_hook_test.go connect: add unix socket to proxy grpc for envoy (#6232) 2019-09-03 08:43:38 -07:00
csi_hook.go csi: add mount_options to volumes and volume requests (#7398) 2020-03-23 13:59:25 -04:00
groupservice_hook.go client: enable configuring enable_tag_override for services 2020-02-10 08:00:55 -06:00
groupservice_hook_test.go update rest of consul packages 2020-02-16 16:25:04 -06:00
health_hook.go add default update stanza and max_parallel=0 disables deployments (#6191) 2019-09-02 10:30:09 -07:00
health_hook_test.go client: improve group service stanza interpolation and check_re… (#6586) 2019-11-18 13:04:01 -05:00
migrate_hook.go client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
network_hook.go driver/networking: don't recreate existing network namespaces 2019-09-25 14:58:17 -04:00
network_hook_test.go driver/networking: don't recreate existing network namespaces 2019-09-25 14:58:17 -04:00
network_manager_linux.go spellcheck: Fix spelling of retrieve 2019-12-05 18:59:47 -06:00
network_manager_linux_test.go ar: rearrange network hook to support building on windows 2019-07-31 01:03:19 -04:00
network_manager_nonlinux.go ar: refactor network bridge config to use go-cni lib (#6255) 2019-09-04 16:33:25 -04:00
networking.go ar: refactor network bridge config to use go-cni lib (#6255) 2019-09-04 16:33:25 -04:00
networking_bridge_linux.go client/networking: wrap error message from CNI plugin (#6316) 2019-09-13 08:20:05 -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 client: enable nomad client to request and set SI tokens for tasks 2020-01-31 19:03:38 -06:00
upstream_allocs_hook.go client: cleanup and document context uses 2019-03-12 15:03:54 -07:00
util.go allocrunnerv2 -> allocrunner 2018-10-16 16:56:56 -07:00