[Networking] wireguard-go embedded in liqo gateway#3276
Open
cheina97 wants to merge 1 commit intoliqotech:masterfrom
Open
[Networking] wireguard-go embedded in liqo gateway#3276cheina97 wants to merge 1 commit intoliqotech:masterfrom
cheina97 wants to merge 1 commit intoliqotech:masterfrom
Conversation
Collaborator
|
Hi @cheina97. Thanks for your PR! I am @adamjensenbot.
Make sure this PR appears in the liqo changelog, adding one of the following labels:
|
fra98
approved these changes
May 7, 2026
Member
Author
|
/rebase test=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the external
wireguard-gobinary approach with an in-process Go library integration. Previously, the gateway container image had to download Go at build time, clone thewireguard-gorepository, compile the binary, and then exec it at runtime as a subprocess. This PR removes all of that in favour of importinggolang.zx2c4.com/wireguarddirectly as a Go dependency and running the userspace WireGuard device inside the gateway process itself.Changes
build/liqo/DockerfileRemoves the multi-step
wireguardbuild layer that:git.zx2c4.com/wireguard-goat a pinned commitThe gateway binary is now self-contained; no external
wireguard-gobinary is needed in the image.pkg/gateway/tunnel/wireguard/netlink.goRewrites
createLinkUserspaceto use the wireguard-go library directly:tun.CreateTUNdevice.Devicewithconn.NewDefaultBind()for the underlying socketwgctrlcan still configure the interface (keys, peers, etc.) through the standard kernel-compatible APIgo.mod/go.sumgolang.zx2c4.com/wireguardfrom indirect to a direct dependencygolang.zx2c4.com/wintunas a new indirect dependency (required by the wireguard library on Windows).gitignoreAdds
.claudedirectory to the ignore list.Motivation
wireguardcomponent image.Options.MTUfield, resolving the long-standing TODO in the previous implementation.wireguard-gobinary present at/usr/bin/wireguard-go.