2 Commits

Author SHA1 Message Date
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
205a8d6dc4
chore: make nethelpers build on all OSes
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>
2021-10-26 22:45:10 +03:00