Skip to content

Commit d69305a

Browse files
committed
fix: userspace wireguard handling
This is a fix for the wrong fix in #11204, which was wrong in two ways: * the ldflags -X override had a wrong variable name, so it had no effect * but the above even if it worked, only covered "mamangement" part of things, while `wgctrl-go` which configures things still has a hardcoded location of `/var/run/`. So the fix is two ways: * replace the location where the socket is created properly * use updated forked wgctrl-go which looks in both locations This keeps all fixes of #11204 - `talosctl cluster create` siderolink agent works properly with `wg` on the host, and Talos uses proper location. Before the fix the location was actually `/var/run` and it randomly failed depending on the race condition of Talos booting up and managing `/var`. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent ee5fee7 commit d69305a

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ GO_BUILDFLAGS ?=
128128
GO_BUILDTAGS ?= tcell_minimal,grpcnotrace
129129
GO_BUILDTAGS_TALOSCTL ?= grpcnotrace
130130
GO_LDFLAGS ?=
131-
GO_MACHINED_LDFLAGS ?= -X golang.zx2c4.com/wireguard/ipc.socketPath=/system/wireguard-sock # see https://github.com/siderolabs/talos/issues/8514
131+
GO_MACHINED_LDFLAGS ?= -X golang.zx2c4.com/wireguard/ipc.socketDirectory=/system/wireguard-sock # see https://github.com/siderolabs/talos/issues/8514
132132
GOAMD64 ?= v2
133133
GOFIPS140 ?= off
134134

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ replace (
1818
// Use nested module.
1919
github.com/siderolabs/talos/pkg/machinery => ./pkg/machinery
2020

21+
// fork to add Talos-specific userspace socket location: https://github.com/siderolabs/talos/issues/8514
22+
golang.zx2c4.com/wireguard/wgctrl => github.com/siderolabs/wgctrl-go v0.0.0-20251029173431-c4fd5f6a4e72
23+
2124
// forked go-yaml that introduces RawYAML interface, which can be used to populate YAML fields using bytes
2225
// which are then encoded as a valid YAML blocks with proper indentiation
2326
gopkg.in/yaml.v3 => github.com/unix4ever/yaml v0.0.0-20220527175918-f17b0f05cf2c

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,8 @@ github.com/siderolabs/siderolink v0.3.15 h1:WSsgKQGJY/ObIKjTcYYGEaGfRMyox+r/Ft+9
665665
github.com/siderolabs/siderolink v0.3.15/go.mod h1:iWdlsHji90zotgDg4+a2zJL2ZMNJckQ8/VwqR39ThBM=
666666
github.com/siderolabs/tcpproxy v0.1.0 h1:IbkS9vRhjMOscc1US3M5P1RnsGKFgB6U5IzUk+4WkKA=
667667
github.com/siderolabs/tcpproxy v0.1.0/go.mod h1:onn6CPPj/w1UNqQ0U97oRPF0CqbrgEApYCw4P9IiCW8=
668+
github.com/siderolabs/wgctrl-go v0.0.0-20251029173431-c4fd5f6a4e72 h1:Boabco/vhoFVTUlPcLr4B27NnYUq1QMZVgMtPvyaDzk=
669+
github.com/siderolabs/wgctrl-go v0.0.0-20251029173431-c4fd5f6a4e72/go.mod h1:T97yPqesLiNrOYxkwmhMI0ZIlJDm+p0PMR8eRVeR5tQ=
668670
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
669671
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
670672
github.com/smira/containerd/v2 v2.0.0-20250806103510-dcf2fc86e156 h1:vxHt7VLqjFtY3c80Al/RTPAxxu7XVQuTeTNkRZb2AOQ=
@@ -953,8 +955,6 @@ golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeu
953955
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
954956
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
955957
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
956-
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10 h1:3GDAcqdIg1ozBNLgPy4SLT84nfcBjr6rhGtXYtrkWLU=
957-
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10/go.mod h1:T97yPqesLiNrOYxkwmhMI0ZIlJDm+p0PMR8eRVeR5tQ=
958958
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
959959
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
960960
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=

internal/app/machined/pkg/controllers/network/link_alias_spec.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ func (ctrl *LinkAliasSpecController) Run(ctx context.Context, r controller.Runti
107107
continue
108108
}
109109

110-
logger.Debug("checking link for alias", zap.String("link", link.Attributes.Name), zap.Any("link", link))
111-
112110
if link.Attributes.Info != nil || nethelpers.LinkType(link.Type) != nethelpers.LinkEther {
113111
// skip non-physical links
114112
continue

0 commit comments

Comments
 (0)