Skip to content

Commit

Permalink
fix: update field name for bus path disk selector
Browse files Browse the repository at this point in the history
`s/buspath/bus_path/`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Dec 27, 2024
1 parent e915c98 commit 01bf844
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/machinery/config/types/v1alpha1/v1alpha1_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions pkg/machinery/config/types/v1alpha1/v1alpha1_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 01bf844

Please sign in to comment.