Bug Report
Description
UnattendedInstallConfig validation reports a field that does not exist in the document. The field is provisioning.diskSelector, but both validation errors name provisioning.volumeSelector.
Reproduce by generating a config and clearing the selector:
$ talosctl gen config demo https://10.0.0.1:6443 --output-dir .
# in controlplane.yaml, replace the UnattendedInstallConfig provisioning block with `provisioning: {}`
$ talosctl validate -c controlplane.yaml -m metal
1 error occurred:
* UnattendedInstallConfig: provisioning.volumeSelector.match is required
There is no volumeSelector key anywhere in UnattendedInstallConfig.
The source is pkg/machinery/config/types/runtime/unattended_install.go:
func (s ProvisioningSpec) Validate() error {
if s.DiskSelector.Match.IsZero() {
return errors.New("provisioning.volumeSelector.match is required")
}
if err := s.DiskSelector.Match.ParseBool(celenv.DiskLocator()); err != nil {
return fmt.Errorf("provisioning.volumeSelector.match: %w", err)
}
return nil
}
Both strings are byte-identical to the ones in LVMVolumeGroupConfig and RAIDArrayConfig, where volumeSelector is the correct field name. It looks like UnattendedInstallConfig was derived from one of those and the field renamed to diskSelector without the messages following. Present since 4160737, the type's first commit.
This is currently the first error some people will hit on 1.14: at least one config generator emits provisioning: {}, so the message lands before anything else does.
Currently drafting a PR for the two strings (plus the three assertions in unattended_install_test.go).
Separately, and not part of that PR: the same naming is in the interface at pkg/machinery/config/config/runtime.go, which declares VolumeSelector() and VolumeWipe() for the diskSelector and wipe fields. Renaming those touches the interface and the consuming controller, so it seemed worth keeping apart from a message fix.
Logs
$ talosctl validate -c controlplane.yaml -m metal
1 error occurred:
* UnattendedInstallConfig: provisioning.volumeSelector.match is required
Environment
- Talos version: v1.14.0-rc.2
- Kubernetes version: n/a (config validation only)
- Platform: metal
Bug Report
Description
UnattendedInstallConfigvalidation reports a field that does not exist in the document. The field isprovisioning.diskSelector, but both validation errors nameprovisioning.volumeSelector.Reproduce by generating a config and clearing the selector:
There is no
volumeSelectorkey anywhere inUnattendedInstallConfig.The source is
pkg/machinery/config/types/runtime/unattended_install.go:Both strings are byte-identical to the ones in
LVMVolumeGroupConfigandRAIDArrayConfig, wherevolumeSelectoris the correct field name. It looks likeUnattendedInstallConfigwas derived from one of those and the field renamed todiskSelectorwithout the messages following. Present since 4160737, the type's first commit.This is currently the first error some people will hit on 1.14: at least one config generator emits
provisioning: {}, so the message lands before anything else does.Currently drafting a PR for the two strings (plus the three assertions in
unattended_install_test.go).Separately, and not part of that PR: the same naming is in the interface at
pkg/machinery/config/config/runtime.go, which declaresVolumeSelector()andVolumeWipe()for thediskSelectorandwipefields. Renaming those touches the interface and the consuming controller, so it seemed worth keeping apart from a message fix.Logs
Environment