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

Fix Vsphere rouding up of volume size #76719

Merged
merged 2 commits into from Apr 24, 2019

Conversation

bertinatto
Copy link
Member

@bertinatto bertinatto commented Apr 17, 2019

What type of PR is this?

/kind bug

What this PR does / why we need it:

Storage plugins treat numbers-only storage size as bytes, however, they round it up to the nearest allocation unit, which is vendor-dependant. The Vsphere plugin, on the other hand, rounds the value up to at least 1 KiB and dispatches the request to the server. Since Vsphere's minimum allocation size is 1 MiB, the request returns an error.

This PR changes the Vsphere plugin so it acts like the other storage plugins. Even though the rounding might not be ideal (doing something different from what was requested by the user), we should have consistency across the the storage plugins.

NONE

/sig storage

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Apr 17, 2019
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Apr 17, 2019
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

@kubernetes/cloud-provider-vsphere-maintainers

@bertinatto bertinatto changed the title [WIP] Fix Vsphere rouding up of volume size Fix Vsphere rouding up of volume size Apr 24, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 24, 2019
@bertinatto
Copy link
Member Author

CC @saad-ali
for approval


By("Creating Storage Class")
storageclass, err := client.StorageV1().StorageClasses().Create(getVSphereStorageClassSpec(DiskSizeSCName, scParameters, nil))
framework.ExpectNoError(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.

Error validation in this package is done in many different ways, example:

Expect(err).To(HaveOccurred())
framework.ExpectNoError(err, fmt.Sprintf("Failed to create storage class with err: %v", err))
framework.ExpectNoError(err)

For consistency's sake, in this patch I only used framework.ExpectNoError(err) .

@@ -35,13 +34,12 @@ const (
)

/*
Test to verify disk size specified in PVC is being honored while volume creation.
Test to verify disk size specified in PVC is being rounded up correctly.
Copy link
Member Author

Choose a reason for hiding this comment

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

It seems we don't run these tests at all, however, I updated this one to make sure it works.

@gnufied
Copy link
Member

gnufied commented Apr 24, 2019

looks good to me. But I want @divyenpatel @BaluDontu to chime in as well.

/approve

@gnufied
Copy link
Member

gnufied commented Apr 24, 2019

/assign @divyenpatel @BaluDontu

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bertinatto, gnufied

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 24, 2019
@frapposelli
Copy link
Member

/lgtm
/priority important-soon

/hold

(holding until somebody from the storage team reviews)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 24, 2019
@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Apr 24, 2019
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 24, 2019
@gnufied
Copy link
Member

gnufied commented Apr 24, 2019

@frapposelli since I have already reviewed from storage team we can remove the hold. Or did you mean someone from vmware storage team?

@divyenpatel
Copy link
Member

RoundUpToMiBInt looks good to me.

@gnufied
Copy link
Member

gnufied commented Apr 24, 2019

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 24, 2019
Copy link
Member

@divyenpatel divyenpatel left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot merged commit e4a57b7 into kubernetes:master Apr 24, 2019
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. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants