This PR introduces the concept of the resource adapter: something which
wraps core resource (which defines presentation) and adds additional
fatures to it which we don't want to have in `pkg/machinery` in the
future, but at the same time there's value in keeping it next to the
resource itself.
If the concept looks good, I will continue doing it same way for other
resources.
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Now the latest value for CPU and Memory is also represented as COSI
resources.
Was going back and forth in the implementation but in the end decided to
use dedicated yaml structures for both CPU and Memory stats because:
- JSON tags are ignored by `go-yaml`, so the output is not really great.
- protobuf Talos definition contains fields which we don't really need
in the YAML output of `talosctl get`.
- current state of Talos resource service does not support protobuf
encoding for resources.
So the plan for Theila is to just use the structure as a dynamic object
without relying on protobufs. At least for now.
Signed-off-by: Artem Chernyshev <artem.0xD2@gmail.com>