open-nomad/jobspec
Danielle Lancashire 78b61de45f
config: Hoist volume.config.source into volume
Currently, using a Volume in a job uses the following configuration:

```
volume "alias-name" {
  type = "volume-type"
  read_only = true

  config {
    source = "host_volume_name"
  }
}
```

This commit migrates to the following:

```
volume "alias-name" {
  type = "volume-type"
  source = "host_volume_name"
  read_only = true
}
```

The original design was based due to being uncertain about the future of storage
plugins, and to allow maxium flexibility.

However, this causes a few issues, namely:
- We frequently need to parse this configuration during submission,
scheduling, and mounting
- It complicates the configuration from and end users perspective
- It complicates the ability to do validation

As we understand the problem space of CSI a little more, it has become
clear that we won't need the `source` to be in config, as it will be
used in the majority of cases:

- Host Volumes: Always need a source
- Preallocated CSI Volumes: Always needs a source from a volume or claim name
- Dynamic Persistent CSI Volumes*: Always needs a source to attach the volumes
                                   to for managing upgrades and to avoid dangling.
- Dynamic Ephemeral CSI Volumes*: Less thought out, but `source` will probably point
                                  to the plugin name, and a `config` block will
                                  allow you to pass meta to the plugin. Or will
                                  point to a pre-configured ephemeral config.
*If implemented

The new design simplifies this by merging the source into the volume
stanza to solve the above issues with usability, performance, and error
handling.
2019-09-13 04:37:59 +02:00
..
test-fixtures Consul service meta (#6193) 2019-08-23 12:49:02 -04:00
parse.go Add sidecar_task stanza parsing (#6104) 2019-08-09 15:18:53 -04:00
parse_group.go config: Hoist volume.config.source into volume 2019-09-13 04:37:59 +02:00
parse_job.go Add sidecar_task stanza parsing (#6104) 2019-08-09 15:18:53 -04:00
parse_network.go Add sidecar_task stanza parsing (#6104) 2019-08-09 15:18:53 -04:00
parse_service.go Consul service meta (#6193) 2019-08-23 12:49:02 -04:00
parse_task.go fixup rebase 2019-08-12 15:41:14 +02:00
parse_test.go Consul service meta (#6193) 2019-08-23 12:49:02 -04:00
utils.go consul: add Connect structs 2019-08-06 08:15:07 -07:00
utils_test.go consul: add Connect structs 2019-08-06 08:15:07 -07:00