Files
nomad/e2e/workload_id/input/nobody.nomad
Charlie Voiselle fe4ff5be2a Add option to expose workload token to task (#15755)
Add `identity` jobspec block to expose workload identity tokens to tasks.

---------

Co-authored-by: Anders <mail@anars.dk>
Co-authored-by: Tim Gross <tgross@hashicorp.com>
Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
2023-02-02 10:59:14 -08:00

34 lines
594 B
HCL

job "nobodyid" {
datacenters = ["dc1"]
type = "batch"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "nobodyid" {
# nobody task should have a file owned by nobody with -rw------- perms
task "nobody" {
user = "nobody"
identity {
file = true
}
driver = "docker"
config {
image = "bash:5"
args = ["-c", "stat -c 'perms=%#a username=%U' secrets/nomad_token; echo done"]
}
resources {
cpu = 16
memory = 32
disk = 64
}
}
}
}