From 960e1923591d5a1b9f283cf7409ca3a835c5d194 Mon Sep 17 00:00:00 2001 From: Thomas Wunderlich Date: Thu, 28 Apr 2022 17:09:53 -0400 Subject: [PATCH] Quick and dirty hack to get interpolated dns values working --- client/allocrunner/taskrunner/task_runner.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/allocrunner/taskrunner/task_runner.go b/client/allocrunner/taskrunner/task_runner.go index b8c3b270c..11de5346e 100644 --- a/client/allocrunner/taskrunner/task_runner.go +++ b/client/allocrunner/taskrunner/task_runner.go @@ -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, } } }