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

Avoid running blockdev command when DV is Filesystem volumeMode #2174

Merged
merged 1 commit into from
Mar 25, 2022

Conversation

nijinashok
Copy link
Contributor

@nijinashok nijinashok commented Mar 2, 2022

What this PR does / why we need it:
As of now, it is passing "/data/disk.img" to GetAvailableSpaceBlock in Filesystem volumeMode, and hence it always runs blockdev command. With this change, the blockdev command will be only executed if it's a device file.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Avoid running blockdev command when DV is Filesystem volumeMode

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 2, 2022
@kubevirt-bot
Copy link
Contributor

Hi @nijinashok. Thanks for your PR.

I'm waiting for a kubevirt member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@nijinashok nijinashok changed the title Fix running blockdev command when DV is Filesystem volumeMode Avoid running blockdev command when DV is Filesystem volumeMode Mar 2, 2022
@mhenriks
Copy link
Member

mhenriks commented Mar 2, 2022

/ok-to-test

@kubevirt-bot kubevirt-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 2, 2022
@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 2, 2022
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Mar 2, 2022
pkg/util/util.go Outdated Show resolved Hide resolved
@brybacki
Copy link
Contributor

/test pull-containerized-data-importer-e2e-k8s-1.22-hpp

@brybacki
Copy link
Contributor

/test pull-containerized-data-importer-e2e-k8s-1.22-nfs

Copy link
Member

@awels awels left a comment

Choose a reason for hiding this comment

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

One small question looks good otherwise.

pkg/util/util.go Outdated
// Check if device exists.
info, err := os.Stat(deviceName)
// Check if the file exists and is a device file.
info, err := os.Lstat(deviceName)
Copy link
Member

Choose a reason for hiding this comment

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

So why change to lstat here? According to the documentation lstat doesn't follow symlinks while stat does. If the file we are looking at is a symlink I think we want to follow it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, lstat change is not needed. Reverted.

As of now, it is passing "/data/disk.img" to GetAvailableSpaceBlock
in Filesystem volumeMode and hence it always run blockdev
command. With this change, the blockdev command will be only executed
if it's a device file.

Signed-off-by: Nijin Ashok <nashok@redhat.com>
@awels
Copy link
Member

awels commented Mar 24, 2022

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 24, 2022
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awels

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 24, 2022
@awels
Copy link
Member

awels commented Mar 24, 2022

/test pull-containerized-data-importer-e2e-k8s-1.22-hpp-istio

@awels
Copy link
Member

awels commented Mar 24, 2022

/test pull-containerized-data-importer-e2e-k8s-1.22-hpp

@awels
Copy link
Member

awels commented Mar 24, 2022

/retest

1 similar comment
@brybacki
Copy link
Contributor

/retest

@awels
Copy link
Member

awels commented Mar 25, 2022

/override pull-containerized-data-importer-e2e-k8s-1.21-hpp
/override pull-containerized-data-importer-e2e-k8s-1.22-upg

@kubevirt-bot
Copy link
Contributor

@awels: Overrode contexts on behalf of awels: pull-containerized-data-importer-e2e-k8s-1.21-hpp, pull-containerized-data-importer-e2e-k8s-1.22-upg

In response to this:

/override pull-containerized-data-importer-e2e-k8s-1.21-hpp
/override pull-containerized-data-importer-e2e-k8s-1.22-upg

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.

@kubevirt-bot kubevirt-bot merged commit dff2550 into kubevirt:main Mar 25, 2022
maya-r added a commit to maya-r/containerized-data-importer that referenced this pull request Mar 28, 2022
Needed after kubevirt#2174

Signed-off-by: Maya Rashish <mrashish@redhat.com>
maya-r added a commit to maya-r/containerized-data-importer that referenced this pull request Apr 12, 2022
Needed after kubevirt#2174

Signed-off-by: Maya Rashish <mrashish@redhat.com>
maya-r added a commit to maya-r/containerized-data-importer that referenced this pull request Apr 12, 2022
Needed after kubevirt#2174

Signed-off-by: Maya Rashish <mrashish@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request Apr 20, 2022
* Retire ember LVM code, unused

(Rationale: avoid having to change more things for changing the
base image)

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Remove unreferenced files from WORKSPACE

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Switch to centos:stream9 as a base image.

It has a significantly longer support cycle than Fedora releases,
and supposedly offers vulnerability scans.

Add a tinyCore.vdi to the repo instead of generating it.
The centos qemu-img has read-only VDI support, so we can't generate
it. Generate it using my system and add to the file-host.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use full names for pulls from dockerhub

CentOS doesn't like short tags

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Avoid specifying checksum for CentOS images.

They expire faster than we can update checksums, this is unfortunate
but perhaps they will soon publish images at a lower rate allowing
us to keep up.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Bump number of open file limit to avoid bazel crashes

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update builder to include #2087, builder based on centos stream9

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update checksums that seem wrong

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update ovirt links: old ones were removed

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Remove unused RPMs

Noticed due to: duplicated checksum but no problem in testsuite,
lack of aarch64 equivalent.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Put nbdkit-vddk-plugin back for amd64.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use quay.io instead of dockerhub.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Install util-linux-core for /usr/sbin/blockdev

Needed after #2174

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Update nbdkit/libnbd/nginx/ovirt versions to the latest

The previous version we were using can't be fetched any more

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Generate our own CentOS stream9 image using RPMs

Now updating the dependencies can be done by running `make rpm-deps`
and committing the change, like kubevirt.

This creates a small complication that we need to run update-ca-trust
to trust root CAs. Do this on the pod, using the entrypoint to do so.

Use a single image with all the dependencies for the test tools, we
don't benefit from making them minimal and it saved some trouble in
the conversion.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Fixup imageio test container

Run update-ca-trust and update-crypto-policies before running
ovirt-imageio, to stop error messages.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants