Quick and dirty hack to get interpolated dns values working

This commit is contained in:
Thomas Wunderlich 2022-04-28 17:09:53 -04:00
parent 6449ba8d41
commit 960e192359
No known key found for this signature in database
GPG key ID: 08A5807C9596AAEB

View file

@ -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,
}
}
}