Skip to content
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

Bug 1899565: support raw block devices #57

Merged
merged 1 commit into from Nov 25, 2020
Merged

Bug 1899565: support raw block devices #57

merged 1 commit into from Nov 25, 2020

Conversation

bennyz
Copy link
Member

@bennyz bennyz commented Nov 22, 2020

Add support for raw block PVCs

@bennyz bennyz requested a review from rgolangh November 22, 2020 16:00
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Nov 22, 2020
@openshift-ci-robot
Copy link

@bennyz: This pull request references Bugzilla bug 1898509, which is invalid:

  • expected the bug to target the "4.7.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1898509: support raw block devices

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 22, 2020
Copy link

@rgolangh rgolangh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good, small question inside

@@ -79,6 +86,10 @@ func (n *NodeService) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag
}

func (n *NodeService) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {
if req.VolumeCapability == nil {
return nil, status.Errorf(codes.InvalidArgument, "Missing volume capability")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when does this happen (the VolumeCapability == nil)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably never, I'll remove

if req.VolumeCapability.GetBlock() != nil {
return n.publishBlockVolume(req, device)
}

targetPath := req.GetTargetPath()
err = os.MkdirAll(targetPath, 0750)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably change this to 640 as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@bennyz bennyz changed the title Bug 1898509: support raw block devices Bug 1899565: support raw block devices Nov 23, 2020
@bennyz
Copy link
Member Author

bennyz commented Nov 23, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. labels Nov 23, 2020
@openshift-ci-robot
Copy link

@bennyz: This pull request references Bugzilla bug 1899565, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link

@bennyz: This pull request references Bugzilla bug 1899565, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1899565: support raw block devices

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Nov 23, 2020
@bennyz bennyz requested a review from rgolangh November 23, 2020 12:25
err = mounter.Mount(device, req.TargetPath, "", []string{"bind"})
if err != nil {
if removeErr := os.Remove(req.TargetPath); removeErr != nil {
return nil, status.Errorf(codes.Internal, "Failed to remove mount target %v, err: %v", req.TargetPath, err)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the removeErr is lost. Maybe wrap both of them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

err = mounter.Mount(device, req.TargetPath, "", []string{"bind"})
if err != nil {
if removeErr := os.Remove(req.TargetPath); removeErr != nil {
return nil, status.Errorf(codes.Internal, "Failed to remove mount target %v, err: %v", req.TargetPath, removeErr)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the failing mount error is lost

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, sorry, I didn't get that at first

err = mounter.Mount(device, req.TargetPath, "", []string{"bind"})
if err != nil {
if removeErr := os.Remove(req.TargetPath); removeErr != nil {
return nil, status.Errorf(codes.Internal, "Failed to remove mount target %v, err: %v, mount error: %v", req.TargetPath, removeErr,)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a nicer way?

Copy link

@rgolangh rgolangh Nov 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your missing the err for the ErrorF, that's it I think:

return nil, status.Errorf(
     codes.Internal,
     "Failed to remove mount target %v, err: %v, mount error: %v",
     req.TargetPath,
     removeErr,
     err)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, status.Errorf(codes.Internal, "Failed to remove mount target %v, err: %v, mount error: %v", req.TargetPath, removeErr,)
return nil, status.Errorf(codes.Internal, "Failed to remove mount target %v, err: %v, mount error: %v", req.TargetPath, removeErr, err)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently trailing commas are allowed

This patch introduces support for block devices via CSI

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@openshift-merge-robot
Copy link

openshift-merge-robot commented Nov 25, 2020

@bennyz: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-ovirt 91d4cd8 link /test e2e-ovirt

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@rgolangh
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 25, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bennyz, rgolangh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@bennyz
Copy link
Member Author

bennyz commented Nov 25, 2020

/retest

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit e01eb6b into openshift:master Nov 25, 2020
@openshift-ci-robot
Copy link

@bennyz: All pull requests linked via external trackers have merged:

Bugzilla bug 1899565 has been moved to the MODIFIED state.

In response to this:

Bug 1899565: support raw block devices

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@bennyz bennyz deleted the support-raw-block branch November 25, 2020 19:19
@Gal-Zaidman
Copy link

/cherry-pick release-4.6

@openshift-cherrypick-robot

@Gal-Zaidman: failed to push cherry-picked changes in GitHub: pushing failed, output: "remote: Repository not found.\nfatal: repository 'https://github.com/openshift-cherrypick-robot/ovirt-csi-driver/' not found\n", error: exit status 128

In response to this:

/cherry-pick release-4.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Gal-Zaidman
Copy link

/cherry-pick release-4.6

@openshift-cherrypick-robot

@Gal-Zaidman: failed to push cherry-picked changes in GitHub: pushing failed, output: "remote: Repository not found.\nfatal: repository 'https://github.com/openshift-cherrypick-robot/ovirt-csi-driver/' not found\n", error: exit status 128

In response to this:

/cherry-pick release-4.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Gal-Zaidman
Copy link

/cherry-pick release-4.6

@openshift-cherrypick-robot

@Gal-Zaidman: failed to push cherry-picked changes in GitHub: pushing failed, output: "remote: Repository not found.\nfatal: repository 'https://github.com/openshift-cherrypick-robot/ovirt-csi-driver/' not found\n", error: exit status 128

In response to this:

/cherry-pick release-4.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@stevekuznetsov
Copy link

/cherry-pick release-4.6

@openshift-cherrypick-robot

@stevekuznetsov: new pull request created: #68

In response to this:

/cherry-pick release-4.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants