Skip to content

Commit

Permalink
whitelisting Ceph disks (/dev/rbdX)
Browse files Browse the repository at this point in the history
  • Loading branch information
def committed Mar 25, 2022
1 parent 75b8ae3 commit f02d005
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion node/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
)

var blockDevice = regexp.MustCompile(`^(dm-\d+|(s|h|xv|v)d[a-z]|md\d+|nvme\d+n\d+)`)
var blockDevice = regexp.MustCompile(`^(dm-\d+|(s|h|xv|v)d[a-z]|md\d+|nvme\d+n\d+|rbd\d+)`)

type DevStat struct {
Name string
Expand Down
2 changes: 1 addition & 1 deletion node/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestGetNodeDisks(t *testing.T) {
}

assert.Equal(t,
[]string{"dm-0", "md1", "nvme0n1", "nvme1n1", "sda", "sdb", "vda", "xvda"},
[]string{"dm-0", "md1", "nvme0n1", "nvme1n1", "rbd0", "rbd1", "sda", "sdb", "vda", "xvda"},
names(d.BlockDevices()),
)
}
4 changes: 3 additions & 1 deletion node/fixtures/diskstats
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
111 0 xvda 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
111 1 xvda1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
252 0 dm-0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
2 0 fd0 0 0 0 0 0 0 0 0 0 0 0
2 0 fd0 0 0 0 0 0 0 0 0 0 0 0
251 0 rbd0 216 0 8642 82 1355 2670 107408 6863 0 6228 6946 0 0 0 0 0 0
251 16 rbd1 121 0 4474 167 1070 2045 97928 4940 0 4664 5107 0 0 0 0 0 0

0 comments on commit f02d005

Please sign in to comment.