Merge pull request #12817 from twunderlich-grapl/fix-network-interpolation

Fix network.dns interpolation
This commit is contained in:
Seth Hoenig 2022-05-17 09:31:32 -05:00 committed by GitHub
commit 26b5c01431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

3
.changelog/12817.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
client: Fixed a bug where network.dns block was not interpolated
```

View File

@ -1042,10 +1042,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,
}
}
}