open-nomad/api
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
..
contexts csi: CLI for volume status, registration/deregistration and plugin status (#7193) 2020-03-23 13:58:30 -04:00
internal/testutil Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
acl.go Self token lookup 2017-10-13 13:12:20 -07:00
acl_test.go Self token lookup 2017-10-13 13:12:20 -07:00
agent.go refactor api profile methods 2020-01-09 15:15:12 -05:00
agent_test.go fix tests, update changelog 2020-01-29 13:55:39 -05:00
allocations.go csi: volumes listed in nomad node status (#7318) 2020-03-23 13:58:30 -04:00
allocations_test.go api: avoid depending on helper internal package 2019-11-12 11:02:33 -05:00
api.go api: check response content length before decoding. 2020-02-20 10:07:44 +01:00
api_test.go api: avoid depending on helper internal package 2019-11-12 11:02:33 -05:00
compose_test.go fix tests from introducing new struct fields 2019-07-31 01:03:16 -04:00
constraint.go core: add semver constraint 2019-11-19 08:40:19 -08:00
constraint_test.go Parallel 2017-07-21 16:33:04 -07:00
csi.go csi: add mount_options to volumes and volume requests (#7398) 2020-03-23 13:59:25 -04:00
csi_test.go csi add allocation context to fingerprinting results (#7133) 2020-03-23 13:58:30 -04:00
deployments.go code review fixes 2018-05-31 10:57:08 -07:00
evaluations.go add create and modify timestamps to evaluations (#5881) 2019-08-07 09:50:35 -07:00
evaluations_test.go non-Existent -> nonexistent 2018-03-12 11:59:33 -07:00
fs.go cli: recover from client ACL lookup failures 2019-10-04 11:23:59 -04:00
fs_test.go Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
go.mod Update go mod 2019-12-16 12:47:10 +01:00
go.sum Update go mod 2019-12-16 12:47:10 +01:00
jobs.go command, docs: create and document consul token configuration for connect acls (gh-6716) 2020-01-31 19:02:53 -06:00
jobs_test.go jobspec: fixup vault_grace deprecation 2020-03-10 14:58:49 -07:00
namespace.go sync 2017-10-13 14:36:02 -07:00
namespace_test.go sync 2017-09-19 10:08:23 -05:00
nodes.go csi: change the API paths to match CLI command layout (#7325) 2020-03-23 13:58:30 -04:00
nodes_test.go Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
operator.go Rename to match system scheduler config. 2019-05-03 14:06:12 -05:00
operator_autopilot.go implement MinQuorum 2020-02-16 16:04:59 -06:00
operator_test.go Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
quota.go sync 2017-10-13 14:36:02 -07:00
quota_test.go sync 2017-10-13 14:36:02 -07:00
raw.go Making the client use tls if the node from which migration has to be made has enabled tls 2016-10-31 10:20:04 -07:00
regions.go fix a copy/paste error on api.Regions() comment 2017-01-17 22:48:01 -08:00
regions_test.go Divest api/ package of deps elsewhere in the nomad repo. (#5488) 2019-03-29 14:47:40 -04:00
resources.go cli: display group ports and address in alloc status command output (#6189) 2019-08-27 23:59:36 -04:00
search.go Search respects QueryOptions and returns QueryMeta 2017-08-27 22:17:51 -07:00
search_test.go Add new reschedule options to API layer and unit tests 2018-03-14 16:10:32 -05:00
sentinel.go sync 2017-09-19 10:08:23 -05:00
sentinel_test.go sync 2017-09-19 10:08:23 -05:00
services.go client: enable configuring enable_tag_override for services 2020-02-10 08:00:55 -06:00
services_test.go client: enable configuring enable_tag_override for services 2020-02-10 08:00:55 -06:00
status.go display server leaders per region 2016-03-17 16:04:09 -07:00
status_test.go Parallel 2017-07-21 16:33:04 -07:00
system.go Add missing ReconcileSummaries API method 2017-08-24 11:55:10 +02:00
system_test.go Parallel 2017-07-21 16:33:04 -07:00
tasks.go csi: add mount_options to volumes and volume requests (#7398) 2020-03-23 13:59:25 -04:00
tasks_test.go remove deadline code for now 2020-03-21 17:52:56 -04:00
util_test.go api: avoid depending on helper internal package 2019-11-12 11:02:33 -05:00
utils.go Update comment on int8ToPtr 2019-01-30 12:23:14 -08:00
utils_test.go api: move formatFloat function 2019-01-18 15:31:31 -05:00