Skip to content

Commit

Permalink
Automatically add Longhorn device to the group id 6 (disk group) by d…
Browse files Browse the repository at this point in the history
…efault (#79)

More explanation is at longhorn/longhorn#8088 (comment)

longhorn-8088

Signed-off-by: Phan Le <[email protected]>
  • Loading branch information
PhanLe1010 authored Mar 8, 2024
1 parent d137da5 commit 8f2980e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ func DuplicateDevice(dev *lhtypes.BlockDeviceInfo, dest string) error {
if err := os.Chmod(dest, 0660); err != nil {
return errors.Wrapf(err, "cannot change permission of the device %s", dest)
}
// We use the group 6 by default because this is common group for disks
// See more at https://github.com/longhorn/longhorn/issues/8088#issuecomment-1982300242
if err := os.Chown(dest, 0, 6); err != nil {
return errors.Wrapf(err, "cannot change ownership of the device %s", dest)
}
return nil
}

Expand Down

0 comments on commit 8f2980e

Please sign in to comment.