Related to #4420
This removes `linux` build tags to make sure all `nethelpers` build on
any OS, as it's part of Talos API (via resources). Constants were
replaced with literal values. Code generated by `stringer` serves as
proof of the change: constant values haven't changed.
Remove build tags from `pkgs/resources/network` now, marking only a part
of single file `_linux` (which converts link spec to low-level netlink
messages).
Theere should be no functional changes.
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Fixes#4094
Deprecate old networkd APIs, `talosctl interfaces` and `talosctl routes`
now suggest different commands to be used to achieve same task.
TUI installer was updated to stop using Interfaces API.
Those APIs will be completely removed in 0.14.
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
* calculate covering IPPrefixes for the KubeSpan peer `AllowedIPs`,
check for overlap
* don't use KubeSpan IP as potential node endpoint (inception!)
* allow Wireguard config to be applied which doesn't change peer
endpoint
* support for pre-shared Wireguard peer keys
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Signed-off-by: Seán C McCord <ulexus@gmail.com>
Co-authored-by: Seán C McCord <ulexus@gmail.com>
* correctly merge wireguard specs across multiple configuration layers
(partially stolen from #3577)
* fix erroneous wireguard reconfig when listen port in the config is
zero
* add tests for link merging (once again, partially stolen from #3577)
* fix ugly bug with LinkSpec Type merging (I believe it's a major source
of pain for you, Seán, in your PR).
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
This PR contains multiple fixes to the networking controllers and
logging improvements for easier debugging:
* `LinkConfigController` now correctly merges duplicate link definitions
in the machine configuration
* `LinkConfigController` correctly enslaves bond interfaces even if
they're not mentioned explicitly in the config
* bond slaves are no longer brought down forcefully, but they're brought
down before being enslaved (and brought up once they're enslaved)
* route sync code ignores flags which are not managed by Talos
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
This is next part of networkd rewrite.
This implements three new resource types coupled with controllers which
process the default configuration, merges and applying changes.
TimeSync was set up to watch the time servers resource. This is a no-op
for now, but once DHCP is implemented, this would enable time server
configuration coming from DHCP.
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
It was a bad choice to name the method which returns resource spec
typecasted to the proper Go type as `Status()`, as certainly `Status`
has a different meaning for resources. So rename the method accordingly
to be `TypedSpec()`.
No functional or user-visbile changes, just renames.
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
The structure of the controllers is really similar to addresses and
routes:
* `LinkSpec` resource describes desired link state
* `LinkConfig` controller generates `LinkSpecs` based on machine
configuration and kernel cmdline
* `LinkMerge` controller merges multiple configuration sources into a
single `LinkSpec` paying attention to the config layer priority
* `LinkSpec` controller applies the specs to the kernel state
Controller `LinkStatus` (which was implemented before) watches the
kernel state and publishes current link status.
Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>