-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include parent job ID as a Docker container label #17751 #17843
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good @devashishTaneja! In addition to the comments I've left, can you run make cl
to add a changelog entry?
I've smoke tested this with the following jobspec:
job "example" {
type = "batch"
parameterized {
payload = "required"
}
group "group" {
task "task" {
driver = "docker"
config {
image = "busybox:1"
command = "/bin/sh"
args = ["-c", "cat local/payload.txt; sleep 300"]
}
dispatch_payload {
file = "payload.txt"
}
}
}
}
After running and dispatching that job, I get the following labels on the resulting container:
$ docker inspect 120 | jq '.[0].Config.Labels'
{
"com.hashicorp.nomad.alloc_id": "45b9fe13-0c85-9b87-0f3d-1c82774d9b5f",
"com.hashicorp.nomad.job_id": "example/dispatch-1688760549-ec1a5470",
"com.hashicorp.nomad.job_name": "example/dispatch-1688760549-ec1a5470",
"com.hashicorp.nomad.parent_job_id": "example",
"com.hashicorp.nomad.task_name": "task"
}
Fix field name for Nitpicky Golang style Add condition to add label only if parent job id is not null (dispatch/ periodic job)
@tgross All the review comments are taken care. Please check |
@tgross Please have a look when possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good @devashishTaneja! Just a couple more items to wrap up.
@tgross taken care of changelog and proto suggestions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @devashishTaneja !
Fixes: #17751