Skip to content

Commit 65c1811

Browse files
author
Thomas Wunderlich
committed
Quick and dirty hack to get interpolated dns values working
1 parent aeff83b commit 65c1811

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

client/allocrunner/taskrunner/task_runner.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -1041,10 +1041,14 @@ func (tr *TaskRunner) buildTaskConfig() *drivers.TaskConfig {
10411041
if alloc.AllocatedResources != nil && len(alloc.AllocatedResources.Shared.Networks) > 0 {
10421042
allocDNS := alloc.AllocatedResources.Shared.Networks[0].DNS
10431043
if allocDNS != nil {
1044+
// could potentially interpolate here
1045+
interpolatedNetworks := taskenv.InterpolateNetworks(env, alloc.AllocatedResources.Shared.Networks)
1046+
tr.logger.Info("allocDNS is set", "dnsserver", allocDNS.Servers)
1047+
tr.logger.Info("interpolatedDNS is set", "dnsserver", interpolatedNetworks[0].DNS.Servers)
10441048
dns = &drivers.DNSConfig{
1045-
Servers: allocDNS.Servers,
1046-
Searches: allocDNS.Searches,
1047-
Options: allocDNS.Options,
1049+
Servers: interpolatedNetworks[0].DNS.Servers,
1050+
Searches: interpolatedNetworks[0].DNS.Searches,
1051+
Options: interpolatedNetworks[0].DNS.Options,
10481052
}
10491053
}
10501054
}

0 commit comments

Comments
 (0)