Fixes#8270
The base bug was that the registry will return `nil` `ConfigDocument` if
the version is not registered for a kind, which would result into weird
config decoding errors.
Add more unit-tests, while at it, also add more fuzzing samples.
Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
Other changes:
* renamed `version:` to `apiVersion:` in the multi-doc format, as this
better matches Kubernetes objects
* introduced (not used at the moment) a concept of `NamedDocuments`
(many documents for the same type)
* added container validation on not having duplicate documents
* JSON6902 now denies multi-doc config
Fixes#7312
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
`config.Container` implements a multi-doc container which implements
both `Container` interface (encoding, validation, etc.), and `Conifg`
interface (accessing parts of the config).
Refactor `generate` and `bundle` packages to support multi-doc, and
provide backwards compatibility.
Implement a first (mostly example) machine config document for
SideroLink API URL.
Many places don't properly support multi-doc yet (e.g. config patches).
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
See #7230
Refactor more config interfaces, move config accessor interfaces
to different package to break the dependency loop.
Make `.RawV1Alpha1()` method typed to avoid type assertions everywhere.
No functional changes.
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>