error on K3D_FIX_DNS=1 with /etc/resolv.conf mounted

pull/871/head
iwilltry42 3 years ago
parent f313b9165e
commit 3cc4c5c5af
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 6
      pkg/client/node.go

@ -492,6 +492,12 @@ func enableFixes(ctx context.Context, runtime runtimes.Runtime, node *k3d.Node,
if fixes.FixEnabled(fixes.EnvFixDNS) {
l.Log().Debugln(">>> enabling dns magic")
for _, v := range node.Volumes {
if strings.Contains(v, "/etc/resolv.conf") {
return fmt.Errorf("[Node %s] Cannot activate DNS fix (K3D_FIX_DNS) when there's a file mounted at /etc/resolv.conf!", node.Name)
}
}
if nodeStartOpts.EnvironmentInfo == nil || nodeStartOpts.EnvironmentInfo.HostGateway == nil {
return fmt.Errorf("Cannot enable DNS fix, as Host Gateway IP is missing!")
}

Loading…
Cancel
Save