Files
nomad/e2e/metrics/input/setup.hcl
Daniel Bennett 2c699b9794 sysbatch: fix panic from reschedule block (#26534)
* fix panic from nil ReschedulePolicy

commit 279775082c (pr #26279)
intended to return an error for sysbatch jobs with a reschedule block,
but in bypassing populating the `ReschedulePolicy`'s pointer fields,
a nil pointer panic occurred before the job could get rejected
with the intended error.

in particular, in `command/agent/job_endpoint.go`, `func ApiTgToStructsTG`,

```
if taskGroup.ReschedulePolicy != nil {
	tg.ReschedulePolicy = &structs.ReschedulePolicy{
		Attempts:      *taskGroup.ReschedulePolicy.Attempts,
		Interval:      *taskGroup.ReschedulePolicy.Interval,
```

`*taskGroup.ReschedulePolicy.Interval` was a nil pointer.

* fix e2e test jobs
2025-08-18 10:19:14 -04:00

72 lines
1.1 KiB
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
job "setup-podman-auth" {
type = "sysbatch"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "create-files" {
restart {
attempts = 0
mode = "fail"
}
task "create-auth-file" {
driver = "raw_exec"
user = "root"
config {
command = "cp"
args = ["${NOMAD_TASK_DIR}/auth.json", "/etc/auth.json"]
}
template {
destination = "local/auth.json"
perms = "644"
data = <<EOH
{}
EOH
}
resources {
cpu = 100
memory = 32
}
}
task "create-helper-file" {
driver = "raw_exec"
user = "root"
config {
command = "cp"
args = ["${NOMAD_TASK_DIR}/test.sh", "/usr/local/bin/docker-credential-test.sh"]
}
template {
destination = "local/test.sh"
perms = "755"
data = <<EOH
#!/usr/bin/env bash
set -euo pipefail
echo "{}"
exit 0
EOH
}
resources {
cpu = 100
memory = 32
}
}
}
}