-
Notifications
You must be signed in to change notification settings - Fork 56
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
Duplicate job block error when using nomad-pack plan for cron jobs #579
Comments
Hi @FirstPiterSky, thanks for reporting this issue. We'll look into it! |
Hi @FirstPiterSky! This fell thru the cracks a bit in the triage process, sorry about that. This is expected behavior. Suppose I have a pack like the following: template file file[[ range $key, $ObjAll := var "jobs" . ]]
job "[[ var "job_prefix" $ ]]_cron_[[ $ObjAll ]]" {
group "app" {
type = "batch"
task "server" {
driver = "raw_exec"
config {
command = "/bin/bash"
args = ["-c", "sleep", "100"]
}
}
}
}
[[- end ]] var filevariable "job_prefix" {
description = "The prefix"
type = string
default = "example"
}
variable "jobs" {
description = "A list of jobs"
type = list(string)
default = ["foo", "bar"]
} If I render that, I get something like the following:
But if I check the contents of the Rendering to disk via |
Description: We are encountering a 400 error when attempting to create tasks in Nomad using the nomad-pack plan command. The error is related to duplicate job blocks in the rendered job file.
Steps to Reproduce:
Expected Behavior: The job specification should be parsed and tasks should be created successfully in Nomad.
Actual Behavior: The command fails with a 400 error due to multiple "job" blocks in the generated file.
The text was updated successfully, but these errors were encountered: