-
Notifications
You must be signed in to change notification settings - Fork 42
Refactor vgmanager #59
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
Conversation
ad0706a
to
4462f14
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.
First round of review. I'll do one more round tomorrow.
@@ -177,6 +175,46 @@ func (r *VGReconciler) reconcile(ctx context.Context, req ctrl.Request) (ctrl.Re | |||
return ctrl.Result{RequeueAfter: requeueAfter}, nil | |||
} | |||
|
|||
func (r *VGReconciler) addDevicesToVG(vgName string, devices []internal.BlockDevice) error { | |||
if len(devices) < 1 { | |||
return fmt.Errorf("can't create vg with 0 devices") |
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 add the vgname to this 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.
done.
pkg/vgmanager/lvm.go
Outdated
if err != nil { | ||
return nil, err | ||
return nil, fmt.Errorf("failed to unmarhsal volume group response. %v", err) |
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.
Typo: "unmarshal"
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.
done
} | ||
|
||
var cmd string | ||
args := []string{vgName} |
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.
Do this after checking if the volume group is already present.
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.
done.
542764d
to
5a6ceec
Compare
Please correct the commit messages (formats) |
- Executor interface and its implementation helps to run os/exec commands Signed-off-by: Santosh Pillai <[email protected]>
- Use `json` response for easy parsing of lsblk output - use executor interface implementation Signed-off-by: Santosh Pillai <[email protected]>
- use `json` response for easy parsing. - use executor interface implementation Signed-off-by: Santosh Pillai <[email protected]>
5a6ceec
to
85a75d6
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 |
os/exec
commands. Helps to write unit tests using mocks.block device
utility to use Executor interface andjson
response for easy parsing.json
response for easy parsingTested changes on SNO-2: