Files
nomad/e2e/consultemplate/input/template_paths.nomad
Tim Gross 4e7ad58d2d E2E: modernize ConsulTemplate test and fix some assertions (#19126)
The `TestTemplateUpdateTriggers` is flaky because of what turned out to be
incompatibility between the Consul agent on the E2E cluster and the HCP Consul
server we were running but hadn't upgraded in a while. Upgrading the HCP Consul
server seems to have fixed the tests, but while I'm in here I've updated this
test suite:

* Port all the consul template test suite off of the old framework, and upgrade to
  using e2e "v3" where feasible.
* Clean up some of the assertions in the update triggers test to make the
  purpose of the test more clear.
* Remove unnecessary default fields from the job specs.

Closes: #19075
2023-11-29 12:16:41 -05:00

51 lines
909 B
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
job "template-paths" {
meta {
ARTIFACT_DEST_DIR = "local/foo/src"
}
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
group "template-paths" {
task "task" {
driver = "docker"
config {
image = "busybox:1"
command = "/bin/sh"
args = ["-c", "sleep 300"]
}
artifact {
source = "https://google.com"
destination = "${NOMAD_META_ARTIFACT_DEST_DIR}"
}
template {
source = "${NOMAD_TASK_DIR}/foo/src"
destination = "${NOMAD_SECRETS_DIR}/foo/dst"
}
template {
destination = "${NOMAD_ALLOC_DIR}/shared.txt"
data = <<EOH
Data shared between all task in alloc dir.
EOH
}
resources {
cpu = 128
memory = 64
}
}
}
}