From d3a5af52a227a14674a4625117dbf7d384c497a1 Mon Sep 17 00:00:00 2001 From: Alejandro Ruiz Date: Fri, 31 Jan 2025 15:40:17 +0100 Subject: [PATCH] Fix networking problems after upgrading K3D --- cmd/dartboard/subcommands/apply.go | 4 +++- internal/tofu/tofu.go | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/dartboard/subcommands/apply.go b/cmd/dartboard/subcommands/apply.go index d68847a3..66ef2f05 100644 --- a/cmd/dartboard/subcommands/apply.go +++ b/cmd/dartboard/subcommands/apply.go @@ -16,7 +16,9 @@ limitations under the License. package subcommands -import "github.com/urfave/cli/v2" +import ( + "github.com/urfave/cli/v2" +) func Apply(cli *cli.Context) error { tf, _, err := prepare(cli) diff --git a/internal/tofu/tofu.go b/internal/tofu/tofu.go index f7fe22c6..30054123 100644 --- a/internal/tofu/tofu.go +++ b/internal/tofu/tofu.go @@ -179,6 +179,14 @@ func (t *Tofu) newWorkspace(ctx context.Context) error { func (t *Tofu) Apply(ctx context.Context) error { t.handleWorkspace(ctx) + if t.IsK3d() { + if os.Getenv("K3D_FIX_DNS") == "" { + if err := os.Setenv("K3D_FIX_DNS", "false"); err != nil { + return err + } + } + } + args := t.commonArgs("apply") return t.exec(nil, args...)