From cb884e89a2b427c2cd0960d8449647455173abc8 Mon Sep 17 00:00:00 2001 From: Phan Le Date: Wed, 6 Mar 2024 16:34:39 -0800 Subject: [PATCH] Automatically add Longhorn device to the group id 6 (disk group) by default More explanation is at https://github.com/longhorn/longhorn/issues/8088#issuecomment-1982300242 longhorn-8088 Signed-off-by: Phan Le --- vendor/github.com/longhorn/go-iscsi-helper/util/util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor/github.com/longhorn/go-iscsi-helper/util/util.go b/vendor/github.com/longhorn/go-iscsi-helper/util/util.go index 96fb382ef..d77b8e2a6 100644 --- a/vendor/github.com/longhorn/go-iscsi-helper/util/util.go +++ b/vendor/github.com/longhorn/go-iscsi-helper/util/util.go @@ -84,6 +84,9 @@ 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) } + if err := os.Chown(dest, 0, 6); err != nil { + return errors.Wrapf(err, "cannot change onwership of the device %s", dest) + } return nil }