Skip to content

Commit

Permalink
Quick and dirty hack to get interpolated dns values working
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Wunderlich committed Apr 28, 2022
1 parent aeff83b commit 65c1811
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client/allocrunner/taskrunner/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1041,10 +1041,14 @@ 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 {
// could potentially interpolate here
interpolatedNetworks := taskenv.InterpolateNetworks(env, alloc.AllocatedResources.Shared.Networks)
tr.logger.Info("allocDNS is set", "dnsserver", allocDNS.Servers)
tr.logger.Info("interpolatedDNS is set", "dnsserver", interpolatedNetworks[0].DNS.Servers)
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 65c1811

Please sign in to comment.