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

Do not use beta API for hyperdisk in multi-writer mode. #1864

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/gce-cloud-provider/compute/cloud-disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ func (d *CloudDisk) GetKMSKeyName() string {

func (d *CloudDisk) GetMultiWriter() bool {
switch {
case d.disk != nil:
return false
case d.disk != nil && d.disk.AccessMode == "READ_WRITE_MANY":
return true
case d.betaDisk != nil:
return d.betaDisk.MultiWriter
default:
Expand Down
13 changes: 5 additions & 8 deletions pkg/gce-cloud-provider/compute/gce-compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,6 @@ func convertV1DiskToBetaDisk(v1Disk *computev1.Disk) *computebeta.Disk {
AccessMode: v1Disk.AccessMode,
}

// Hyperdisk doesn't currently support multiWriter (https://cloud.google.com/compute/docs/disks/hyperdisks#limitations),
// but if multiWriter + hyperdisk is supported in the future, we want the PDCSI driver to support this feature without
// any additional code change.
if v1Disk.ProvisionedIops > 0 {
betaDisk.ProvisionedIops = v1Disk.ProvisionedIops
}
Expand Down Expand Up @@ -619,9 +616,6 @@ func convertBetaDiskToV1Disk(betaDisk *computebeta.Disk) *computev1.Disk {
AccessMode: betaDisk.AccessMode,
}

// Hyperdisk doesn't currently support multiWriter (https://cloud.google.com/compute/docs/disks/hyperdisks#limitations),
// but if multiWriter + hyperdisk is supported in the future, we want the PDCSI driver to support this feature without
// any additional code change.
if betaDisk.ProvisionedIops > 0 {
v1Disk.ProvisionedIops = betaDisk.ProvisionedIops
}
Expand Down Expand Up @@ -651,7 +645,8 @@ func (cloud *CloudProvider) insertRegionalDisk(
gceAPIVersion = GCEAPIVersionV1
)

if multiWriter {
// Use beta API for non-hyperdisk types in multi-writer mode.
if multiWriter && !strings.Contains(params.DiskType, "hyperdisk") {
gceAPIVersion = GCEAPIVersionBeta
}

Expand Down Expand Up @@ -778,7 +773,9 @@ func (cloud *CloudProvider) insertZonalDisk(
opName string
gceAPIVersion = GCEAPIVersionV1
)
if multiWriter {

// Use beta API for non-hyperdisk types in multi-writer mode.
if multiWriter && !strings.Contains(params.DiskType, "hyperdisk") {
gceAPIVersion = GCEAPIVersionBeta
}

Expand Down