-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
volumes: return better error messages for unsupported task drivers #8030
Conversation
da53f64
to
e92ed1e
Compare
60d9d60
to
e3af3a6
Compare
…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.
Cherry-picked to 0.11.3 branch as 4b0fe71 |
hi, this error is still present in job "host_volume_1" {
datacenters = ["dc1"]
type = "batch"
group "mygroup" {
volume "myworkspace" {
type = "host"
source = "workspace"
read_only = true
}
task "mytask" {
driver = "raw_exec"
volume_mount {
volume = "myworkspace"
destination = "/myworkspace"
}
template {
data = <<EOH
#!/bin/bash
set -u
id -a
hostname
env | sort
sleep 30
EOH
destination = "local/runme.bash"
}
config {
command = "/bin/bash"
args = ["-x", "local/runme.bash"]
}
}
}
} |
Hi @shantanugadgil You should be getting an error because the |
@tgross the issue is that The error is seen in the |
Yes, that's a known limitation. See the top of the PR:
But if you want to open a new issue with that as a feature request, feel free! |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #7774 (partially #6664 as well)
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 driverCapabilities
response. We validate this when thecsi_hook
orvolume_hook
fires and return a user-friendly error.Three notes:
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.