diff --git a/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go b/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go index ee0f6e7b93..6292c8ddf3 100644 --- a/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go +++ b/pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go @@ -1371,7 +1371,7 @@ func (i *InstallConfig) DiskMatchExpression() (*cel.Expression, error) { } if selector.BusPath != "" { - exprs = append(exprs, patternMatcherExpr(selector.BusPath, "buspath")) + exprs = append(exprs, patternMatcherExpr(selector.BusPath, "bus_path")) } // exclude readonly disks: !disk.readonly diff --git a/pkg/machinery/config/types/v1alpha1/v1alpha1_provider_test.go b/pkg/machinery/config/types/v1alpha1/v1alpha1_provider_test.go index 812db8320e..fdf2eaaa6a 100644 --- a/pkg/machinery/config/types/v1alpha1/v1alpha1_provider_test.go +++ b/pkg/machinery/config/types/v1alpha1/v1alpha1_provider_test.go @@ -77,6 +77,16 @@ disk.rotational && !disk.readonly && !disk.cdrom`, expected: `disk.transport != "" && !disk.rotational && !disk.readonly && !disk.cdrom`, }, + { + name: "bus path", + + selector: v1alpha1.InstallDiskSelector{ + BusPath: "/pci-0000:00:1f.2/*", + }, + + expected: `disk.transport != "" && glob("/pci-0000:00:1f.2/*", disk.bus_path) && !disk.readonly && +!disk.cdrom`, + }, } { t.Run(test.name, func(t *testing.T) { t.Parallel()