Skip to content

Commit

Permalink
Backport of Fix network.dns interpolation into release/1.2.x (#13042)
Browse files Browse the repository at this point in the history
This pull request was automerged via backport-assistant
  • Loading branch information
hc-github-team-nomad-core authored May 17, 2022
1 parent 46d0264 commit 4760533
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/12817.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
client: Fixed a bug where network.dns block was not interpolated
```
7 changes: 4 additions & 3 deletions client/allocrunner/taskrunner/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1030,10 +1030,11 @@ func (tr *TaskRunner) buildTaskConfig() *drivers.TaskConfig {
if alloc.AllocatedResources != nil && len(alloc.AllocatedResources.Shared.Networks) > 0 {
allocDNS := alloc.AllocatedResources.Shared.Networks[0].DNS
if allocDNS != nil {
interpolatedNetworks := taskenv.InterpolateNetworks(env, alloc.AllocatedResources.Shared.Networks)
dns = &drivers.DNSConfig{
Servers: allocDNS.Servers,
Searches: allocDNS.Searches,
Options: allocDNS.Options,
Servers: interpolatedNetworks[0].DNS.Servers,
Searches: interpolatedNetworks[0].DNS.Searches,
Options: interpolatedNetworks[0].DNS.Options,
}
}
}
Expand Down

0 comments on commit 4760533

Please sign in to comment.