Skip to content

fix: userspace wireguard library overrides#11204

Merged
talos-bot merged 1 commit intosiderolabs:mainfrom
smira:fix/wireguard-userspace
Jun 12, 2025
Merged

fix: userspace wireguard library overrides#11204
talos-bot merged 1 commit intosiderolabs:mainfrom
smira:fix/wireguard-userspace

Conversation

@smira
Copy link
Copy Markdown
Member

@smira smira commented Jun 12, 2025

Drop using the fork https://github.com/siderolabs/wireguard-go which had a single change to the variable.

Instead, patch the variable using Go linker flags and only for machined.

This fixes the issue with wg utility not working for talosctl cluster create --with-siderolink clsuters, as it was using incompatible path.

We do need to override the path for Talos only, as in Talos /var/run is not always available, but outside of Talos itself we never need this change at all.

Drop using the fork https://github.com/siderolabs/wireguard-go which had
a single change to the variable.

Instead, patch the variable using Go linker flags and only for
`machined`.

This fixes the issue with `wg` utility not working for `talosctl cluster
create --with-siderolink` clsuters, as it was using incompatible path.

We do need to override the path for Talos only, as in Talos `/var/run`
is not always available, but outside of Talos itself we never need this
change at all.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira
Copy link
Copy Markdown
Member Author

smira commented Jun 12, 2025

So to make it more clear:

  • when we use userspace Wireguard inside Talos, we do need to override UAPI socket path to /system/...
  • when we do anything outside Talos, e.g. in talosctl, this hurts, as makes it incompatible with CLIs like wg

@github-project-automation github-project-automation bot moved this from In Review to Approved in Planning Jun 12, 2025
@smira
Copy link
Copy Markdown
Member Author

smira commented Jun 12, 2025

/m

@talos-bot talos-bot merged commit 9642198 into siderolabs:main Jun 12, 2025
55 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in Planning Jun 12, 2025
smira added a commit to smira/talos that referenced this pull request Oct 29, 2025
This is a fix for the wrong fix in siderolabs#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 siderolabs#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>
smira added a commit to smira/talos that referenced this pull request Oct 30, 2025
This is a fix for the wrong fix in siderolabs#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 siderolabs#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>
shanduur pushed a commit to shanduur/talos that referenced this pull request Nov 5, 2025
This is a fix for the wrong fix in siderolabs#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 siderolabs#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>
(cherry picked from commit d69305a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants