5 Commits

Author SHA1 Message Date
Andrey Smirnov
f9c46fb18d
fix: unmarshal HardwareAddr without stdlib help
Stdlib `net.ParseMAC` does lots of validations, but some hardware addrs
we can see (on logical interfaces) are not valid, so parse MACs in a
simple way.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-05-26 23:30:31 +04:00
Andrey Smirnov
f2e94d6020
fix: implement unmarshaling from YAML for LinkStatus
This adds missing conversion back from text as needed.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-05-26 22:39:00 +04:00
Andrey Smirnov
d02d944ec7
chore: provide umarshal from YAML methods for network resource specs
This will be required to preserve platform network configuration in a
cache across boots. Network configuration will be marshaled to YAML and
unmarshaled back.

Changes are pretty simple and most of the code is auto-generated:
replace `stringer` codegen with `enumer` which produces also methods
which convert from string back to enum values.

Added tests to verify YAML marshaling/unmarshaling.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-01-10 17:00:53 +03:00
Andrey Smirnov
b450b7cef0
chore: deprecate Interfaces and Routes APIs
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>
2021-09-27 15:21:02 +03:00
Andrey Smirnov
5811f4dda1 feat: implement link (interface) controllers
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>
2021-06-01 09:36:25 -07:00