open-nomad/client/pluginmanager/csimanager
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
..
doc.go csi: Add VolumeManager (#6920) 2020-03-23 13:58:29 -04:00
fingerprint.go csi: add Provider field to CSI CLIs and APIs (#7285) 2020-03-23 13:58:30 -04:00
fingerprint_test.go csi: Add VolumeManager (#6920) 2020-03-23 13:58:29 -04:00
instance.go csi: stub fingerprint on instance manager shutdown (#7388) 2020-03-23 13:59:25 -04:00
instance_test.go csi: stub fingerprint on instance manager shutdown (#7388) 2020-03-23 13:59:25 -04:00
interface.go csi: add mount_options to volumes and volume requests (#7398) 2020-03-23 13:59:25 -04:00
manager.go csi: dynamically update plugin registration (#7386) 2020-03-23 13:59:25 -04:00
manager_test.go csi: dynamically update plugin registration (#7386) 2020-03-23 13:59:25 -04:00
usage_tracker.go csi: Basic volume usage tracking 2020-03-23 13:58:30 -04:00
usage_tracker_test.go csi: Basic volume usage tracking 2020-03-23 13:58:30 -04:00
volume.go csi: add mount_options to volumes and volume requests (#7398) 2020-03-23 13:59:25 -04:00
volume_test.go csi: add mount_options to volumes and volume requests (#7398) 2020-03-23 13:59:25 -04:00