Conversation
bba2432 to
596a924
Compare
nbalacha
left a comment
There was a problem hiding this comment.
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.
We will need to build for multiple archs.
There was a problem hiding this comment.
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.
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) { |
| 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.
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.
Does this skip the installation disk?
There was a problem hiding this comment.
No. Right now there is no filter. we just return all the devices back.
There was a problem hiding this comment.
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
| SysVolName = "sys" | ||
|
|
||
| LVMdDir = "/mnt/lvmd/" | ||
| LVMdDir = "/etc/topolvm" |
There was a problem hiding this comment.
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.
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.
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.
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.
- Is the value of
topolvm.DefaultLVMdSocketand 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.
Read block devices properties using lsblk Co-authored-by: Rohan CJ <rohantmp@gmail.com> Signed-off-by: Santosh Pillai <sapillai@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
9e10c23 to
6fccbdd
Compare
|
|
||
| // load lvmd config | ||
| lvmdConfig := &lvmdCMD.Config{ | ||
| SocketName: topolvm.DefaultLVMdSocket, |
There was a problem hiding this comment.
Please replace this with controllers.LVMdSocketPath
Co-authored-by: Rohan CJ <rohantmp@gmail.com> Signed-off-by: Santosh Pillai <sapillai@redhat.com>
Co-authored-by: Rohan CJ <rohantmp@gmail.com> Signed-off-by: Santosh Pillai <sapillai@redhat.com>
Co-authored-by: Rohan CJ <rohantmp@gmail.com> Signed-off-by: Santosh Pillai <sapillai@redhat.com>
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. DetailsNeeds 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)