Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
flexdriver: size isn't needed in attach flow
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Golan <[email protected]>
  • Loading branch information
rgolangh committed Feb 5, 2018
1 parent 310bd50 commit 531acb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/ovirt-flexdriver/ovirt-flexdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func Attach(jsonOpts string, nodeName string) (internal.Response, error) {
_, noAttachment := err.(internal.NotFound)
if noAttachment {
attachment, err =
ovirt.CreateDisk(fromk8sNameToOvirt(r.VolumeName), r.StorageDomain, r.Size, r.Mode == "ro", vm.Id, diskResult.Disks[0].Id, "virtio_scsi")
ovirt.CreateDisk(fromk8sNameToOvirt(r.VolumeName), r.StorageDomain, r.Mode == "ro", vm.Id, diskResult.Disks[0].Id, "virtio_scsi")
if err != nil {
return internal.FailedResponseFromError(err), err
}
Expand Down
13 changes: 3 additions & 10 deletions internal/ovirt-mini-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package internal

import (
"code.cloudfoundry.org/bytefmt"
"crypto/tls"
"crypto/x509"
"encoding/json"
Expand Down Expand Up @@ -177,7 +176,7 @@ func (ovirt Ovirt) GetDiskByName(diskName string) (DiskResult, error) {
return diskResult, err
}

func (ovirt *Ovirt) CreateUnattachedDisk(diskName string, storageDomainName string, sizeIbBytes int, readOnly bool, format string) (Disk, error) {
func (ovirt *Ovirt) CreateUnattachedDisk(diskName string, storageDomainName string, sizeIbBytes int64, readOnly bool, format string) (Disk, error) {
disk := Disk{
Name: diskName,
ProvisionedSize: uint64(sizeIbBytes),
Expand All @@ -197,22 +196,16 @@ func (ovirt *Ovirt) CreateUnattachedDisk(diskName string, storageDomainName stri
func (ovirt *Ovirt) CreateDisk(
diskName string,
storageDomainName string,
size string,
readOnly bool,
vmId string,
diskId string,
diskInterface string) (DiskAttachment, error) {

s, err := bytefmt.ToBytes(size)
if err != nil {
return DiskAttachment{}, err
}
a := DiskAttachment{
Active: true,
Disk: Disk{
Name: diskName,
ProvisionedSize: s,
Format: "raw",
Name: diskName,
Format: "raw",
StorageDomains: StorageDomains{
[]StorageDomain{{Name: storageDomainName}},
},
Expand Down

0 comments on commit 531acb2

Please sign in to comment.