Skip to content

Commit 4464b72

Browse files
floklismira
authored andcommitted
fix: qemu: always use runtime.GOARCH for CNI bundle
The CNI is executed on the host. Even if we want to run an arm64 qemu, we still need to execute the amd64 CNI on the host. Signed-off-by: Florian Klink <flokli@flokli.de> Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
1 parent e7379c8 commit 4464b72

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/provision/providers/qemu/preflight.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"fmt"
1010
"os"
1111
"path/filepath"
12+
"runtime"
1213
"strings"
1314

1415
"github.com/coreos/go-iptables/iptables"
@@ -164,8 +165,9 @@ func (check *preflightCheckContext) cniBundle(ctx context.Context) error {
164165
}
165166

166167
client := getter.Client{
167-
Ctx: ctx,
168-
Src: strings.ReplaceAll(check.request.Network.CNI.BundleURL, constants.ArchVariable, check.options.TargetArch),
168+
Ctx: ctx,
169+
// Network CNI runs on the host
170+
Src: strings.ReplaceAll(check.request.Network.CNI.BundleURL, constants.ArchVariable, runtime.GOARCH),
169171
Dst: check.request.Network.CNI.BinPath[0],
170172
Pwd: pwd,
171173
Mode: getter.ClientModeDir,

0 commit comments

Comments
 (0)