From ca945cfa32e1796787b6eb1db878d1d5e4d665e3 Mon Sep 17 00:00:00 2001 From: sjswerdlow <109298351+sjswerdlow@users.noreply.github.com> Date: Wed, 22 Jan 2025 16:34:56 -0500 Subject: [PATCH] Karkunpavan (#4) * Removing alpha disk from tests. * Changes setup the test to run with hyperdisk extreme. * Updates the disk type back to balanced, as HDX doesn't support multi writer. * Moving over to m1 megamem as thats the only type of machine that can support all needed disk types. * Changes update the tests to use two contexts, one for multiwriter and one for the existing tests. This was deemed necessary as only some disks can support multi-writer, and only some VM shapes can support said disks. * Changes update the tests to use two contexts, one for multiwriter and one for the existing tests. This was deemed necessary as only some disks can support multi-writer, and only some VM shapes can support said disks. * Fixing some git oddness * Fixing some formatting. * More formatting fixes. * Hopefully last changes for formatting. * Fixing linting issue. * Cleaning up un-used / un-needed GetMultiWriter test function. --- pkg/gce-cloud-provider/compute/cloud-disk.go | 13 ------------- pkg/gce-cloud-provider/compute/fake-gce.go | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/gce-cloud-provider/compute/cloud-disk.go b/pkg/gce-cloud-provider/compute/cloud-disk.go index 71ed6490b..c4e60b2e0 100644 --- a/pkg/gce-cloud-provider/compute/cloud-disk.go +++ b/pkg/gce-cloud-provider/compute/cloud-disk.go @@ -213,19 +213,6 @@ func (d *CloudDisk) GetKMSKeyName() string { return "" } -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: - return false - } -} - func (d *CloudDisk) GetEnableConfidentialCompute() bool { switch { case d.disk != nil: diff --git a/pkg/gce-cloud-provider/compute/fake-gce.go b/pkg/gce-cloud-provider/compute/fake-gce.go index f2289a398..fee1e9fa8 100644 --- a/pkg/gce-cloud-provider/compute/fake-gce.go +++ b/pkg/gce-cloud-provider/compute/fake-gce.go @@ -213,7 +213,7 @@ func (cloud *FakeCloudProvider) ValidateExistingDisk(ctx context.Context, resp * } // We are assuming here that a multiWriter disk could be used as non-multiWriter - if multiWriter && !resp.GetMultiWriter() { + if multiWriter { return fmt.Errorf("disk already exists with incompatible capability. Need MultiWriter. Got non-MultiWriter") }