From 7fd43a41930806b8c8fb7b872ed6ae8d324eac16 Mon Sep 17 00:00:00 2001 From: Oscar Wieman Date: Wed, 2 Sep 2026 00:11:36 +0200 Subject: [PATCH] fix: name diskSelector in UnattendedInstallConfig validation errors `ProvisioningSpec.Validate` reported `provisioning.volumeSelector.match`, but the field is `provisioning.diskSelector`. There is no `volumeSelector` key in `UnattendedInstallConfig`, so the message pointed at a field that does not exist. Both strings are identical to the ones in `LVMVolumeGroupConfig` and `RAIDArrayConfig`, where `volumeSelector` is the correct name; this type appears to have been derived from one of those and the field renamed to `diskSelector` without the messages following. Signed-off-by: Oscar Wieman --- pkg/machinery/config/types/runtime/unattended_install.go | 4 ++-- .../config/types/runtime/unattended_install_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/machinery/config/types/runtime/unattended_install.go b/pkg/machinery/config/types/runtime/unattended_install.go index 16f5d7a29b3..dada2260f6d 100644 --- a/pkg/machinery/config/types/runtime/unattended_install.go +++ b/pkg/machinery/config/types/runtime/unattended_install.go @@ -112,11 +112,11 @@ func (s ProvisioningSpec) IsZero() bool { // Validate parses selector without mutating stored config. func (s ProvisioningSpec) Validate() error { if s.DiskSelector.Match.IsZero() { - return errors.New("provisioning.volumeSelector.match is required") + return errors.New("provisioning.diskSelector.match is required") } if err := s.DiskSelector.Match.ParseBool(celenv.DiskLocator()); err != nil { - return fmt.Errorf("provisioning.volumeSelector.match: %w", err) + return fmt.Errorf("provisioning.diskSelector.match: %w", err) } return nil diff --git a/pkg/machinery/config/types/runtime/unattended_install_test.go b/pkg/machinery/config/types/runtime/unattended_install_test.go index 8e2763c1a81..853b1102b50 100644 --- a/pkg/machinery/config/types/runtime/unattended_install_test.go +++ b/pkg/machinery/config/types/runtime/unattended_install_test.go @@ -90,7 +90,7 @@ func TestUnattendedInstallValidate(t *testing.T) { { name: "empty", cfg: runtime.NewUnattendedInstallConfigV1Alpha1, - expectedError: "provisioning.volumeSelector.match is required", + expectedError: "provisioning.diskSelector.match is required", expectedWarnings: []string{ "installer.image is not set, if Talos is not booted from asset built by Image Factory, installation will fail", }, @@ -108,14 +108,14 @@ func TestUnattendedInstallValidate(t *testing.T) { }, }, { - name: "no volume selector match", + name: "no disk selector match", cfg: func() *runtime.UnattendedInstallConfigV1Alpha1 { cfg := runtime.NewUnattendedInstallConfigV1Alpha1() cfg.Installer.Image = "factory.talos.dev/metal-installer/376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba:v1.0.0" return cfg }, - expectedError: "provisioning.volumeSelector.match is required", + expectedError: "provisioning.diskSelector.match is required", }, { name: "invalid match expression", @@ -131,7 +131,7 @@ func TestUnattendedInstallValidate(t *testing.T) { return cfg }, - expectedError: "provisioning.volumeSelector.match: expression output type is int, expected bool", + expectedError: "provisioning.diskSelector.match: expression output type is int, expected bool", }, { name: "valid config",