-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement vgmanager #27
Conversation
bba2432
to
596a924
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial comment: please reorder commits as follows:
- blockutil
- vgmanager implementation (includes main.go changes from current build commit)
- build (only makefile and dockerfile changes)
- go mod tidy
596a924
to
e53a2a7
Compare
e53a2a7
to
248ca01
Compare
COPY controllers/ controllers/ | ||
|
||
# Build | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o vgmanager cmd/vgmanager/main.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to build for multiple archs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about we do it in a new PR since we have to do it for the operator image as well ?
cmd/vgmanager/main.go
Outdated
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") | ||
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") | ||
opts := zap.Options{ | ||
Development: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be set to false in the future. This is fine for now.
pkg/internal/blockutil.go
Outdated
} | ||
|
||
// GetSize as int64 | ||
func (b BlockDevice) GetSize() (int64, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not uint64?
if err != nil { | ||
r.Log.Error(err, "reconcile error") | ||
} | ||
r.Log.V(1).Info("reconcile complete", "result", res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is r.Log.V(1)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. Looks like different verbosity levels. I'll remove it.
// filterMatchingDevices returns unmatched and matched blockdevices | ||
func filterMatchingDevices(blockDevices []internal.BlockDevice, lvmCluster lvmv1alpha1.DeviceClass) ([]internal.BlockDevice, []internal.BlockDevice, error) { | ||
// currently just match all devices | ||
return []internal.BlockDevice{}, blockDevices, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this skip the installation disk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Right now there is no filter. we just return all the devices back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spoke too soon. Yes there is a check. There is a filter called noBiosBootInPartLabel
. It checks for bios
or boot
in the disk part label. Based on our experience with LSO so far, it might not be enough cover all the cases.
248ca01
to
b4cecca
Compare
@@ -33,12 +33,12 @@ var ( | |||
DevDirVolName = "device-dir" | |||
SysVolName = "sys" | |||
|
|||
LVMdDir = "/mnt/lvmd/" | |||
LVMdDir = "/etc/topolvm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is the directory where the lvmd config file is stored, then this can cause problems, because we already have another constant with the complete file path. So in case of change, everybody must know that we need to change this other constant.
I suggest to use only the "LvmdConfigFile" constant , and if it is needed extract the base path from the constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I would like to take this up in a follow up PR.
FSType string `json:"fsType"` | ||
Size string `json:"size"` | ||
// Children []BlockDevice `json:"children,omitempty"` | ||
Rotational string `json:"rota"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a different names (struct/json) only can drive to confusion. I would suggest to use the same names in both parts... so instead of "rota" use "rotational" , ro/readonly, rm/removable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would take this is up in a follow up PR while working on this comment
b4cecca
to
e4558eb
Compare
|
||
// load lvmd config | ||
lvmdConfig := &lvmdCMD.Config{ | ||
SocketName: topolvm.DefaultLVMdSocket, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Is the value of
topolvm.DefaultLVMdSocket
and what's supplied at https://github.com/red-hat-storage/lvm-operator/blob/7b5eb349b5fd22374b24b6b571238999c6c68e7b/controllers/topolvm_node.go#L277 to nodeplugin same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read block devices properties using lsblk Co-authored-by: Rohan CJ <[email protected]> Signed-off-by: Santosh Pillai <[email protected]>
Signed-off-by: Santosh Pillai <[email protected]>
9e10c23
to
6fccbdd
Compare
|
||
// load lvmd config | ||
lvmdConfig := &lvmdCMD.Config{ | ||
SocketName: topolvm.DefaultLVMdSocket, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace this with controllers.LVMdSocketPath
Co-authored-by: Rohan CJ <[email protected]> Signed-off-by: Santosh Pillai <[email protected]>
Co-authored-by: Rohan CJ <[email protected]> Signed-off-by: Santosh Pillai <[email protected]>
Co-authored-by: Rohan CJ <[email protected]> Signed-off-by: Santosh Pillai <[email protected]>
6fccbdd
to
d787cc0
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nbalacha, sp98 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR is based on the Rohan's PR
Testing on SNO cluster:
TODO (in follow up PRs)