mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
jobspec: allow artifact headers in HCLv1 (#14637)
* jobspec: allow artifact headers in HCLv1 Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
This commit is contained in:
3
.changelog/14637.txt
Normal file
3
.changelog/14637.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
jobspec: Fixed a bug where an `artifact` with `headers` configuration would fail to parse when using HCLv1
|
||||
```
|
||||
@@ -370,6 +370,7 @@ func parseArtifacts(result *[]*api.TaskArtifact, list *ast.ObjectList) error {
|
||||
valid := []string{
|
||||
"source",
|
||||
"options",
|
||||
"headers",
|
||||
"mode",
|
||||
"destination",
|
||||
}
|
||||
|
||||
@@ -628,6 +628,13 @@ func TestParse(t *testing.T) {
|
||||
GetterOptions: nil,
|
||||
RelativeDest: stringToPtr("var/foo"),
|
||||
},
|
||||
{
|
||||
GetterSource: stringToPtr("https://example.com/file.txt"),
|
||||
GetterHeaders: map[string]string{
|
||||
"User-Agent": "nomad",
|
||||
"X-Nomad-Alloc": "alloc",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -20,6 +20,15 @@ job "binstore-storagelocker" {
|
||||
source = "http://foo.com/bam"
|
||||
destination = "var/foo"
|
||||
}
|
||||
|
||||
artifact {
|
||||
source = "https://example.com/file.txt"
|
||||
|
||||
headers {
|
||||
User-Agent = "nomad"
|
||||
X-Nomad-Alloc = "alloc"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user