From 14977d16c8b3c31d7c54ae9691cb340fcb2c0631 Mon Sep 17 00:00:00 2001 From: Edgar Garcia <63310723+edgarulg@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:14:14 -0600 Subject: [PATCH] feat(gce): add support for hyperdisk in GCE (#10149) * test(gce): add hyperdisk-balanced in defaults for testing * Revert "test(gce): add hyperdisk-balanced in defaults for testing" This reverts commit a1b160baa73aeef1ae11d9d463428f434c388391. * feat(gce): add hyperdisk-balanced in persistentDiskTypes options * feat(gce): add hyperdisk in handlePersistentDiskChange * test(gce): add logs for debug * feat(gce): add hyperdisk in serverGroupCommandBuilder * feat(gce): add hyperdisk in getPersistentDisks for serverGroupCommandBuilder * Revert "test(gce): add logs for debug" This reverts commit c4ca6f2dffd9d9fb31830a68338d164d520e5f2f. --- .../configure/serverGroupCommandBuilder.service.js | 8 ++++++-- .../configure/serverGroupConfiguration.service.js | 2 +- .../wizard/advancedSettings/diskConfigurer.component.ts | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js b/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js index 7c34e0c55bc..3ef9e98e9ec 100644 --- a/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js +++ b/packages/google/src/serverGroup/configure/serverGroupCommandBuilder.service.js @@ -104,7 +104,9 @@ angular } }); const localSSDDisks = disks.filter((disk) => disk.type === 'local-ssd'); - const persistentDisks = disks.filter((disk) => disk.type.startsWith('pd-')); + const persistentDisks = disks.filter( + (disk) => disk.type.startsWith('pd-') || disk.type.startsWith('hyperdisk-'), + ); if (persistentDisks.length) { command.disks = persistentDisks.concat(localSSDDisks); @@ -149,7 +151,9 @@ angular } function getPersistentDisks(command) { - return (command.disks || []).filter((disk) => disk.type.startsWith('pd-')); + return (command.disks || []).filter( + (disk) => disk.type.startsWith('pd-') || disk.type.startsWith('hyperdisk-'), + ); } function calculatePersistentDiskOverriddenStorageDescription(command) { diff --git a/packages/google/src/serverGroup/configure/serverGroupConfiguration.service.js b/packages/google/src/serverGroup/configure/serverGroupConfiguration.service.js index c054b313610..e3b779900f4 100644 --- a/packages/google/src/serverGroup/configure/serverGroupConfiguration.service.js +++ b/packages/google/src/serverGroup/configure/serverGroupConfiguration.service.js @@ -61,7 +61,7 @@ angular gceTagManager, gceLoadBalancerSetTransformer, ) { - const persistentDiskTypes = ['pd-standard', 'pd-ssd']; + const persistentDiskTypes = ['pd-standard', 'pd-ssd', 'hyperdisk-balanced']; const authScopes = [ 'cloud-platform', 'userinfo.email', diff --git a/packages/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts b/packages/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts index 356cd13e446..98a7afeee7c 100644 --- a/packages/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts +++ b/packages/google/src/serverGroup/configure/wizard/advancedSettings/diskConfigurer.component.ts @@ -84,7 +84,9 @@ class GceDiskConfigurerController implements IComponentController { } private sortDisks(disks: IGceDisk[]): IGceDisk[] { - const diskWithoutImage = disks.find((disk) => disk.type.startsWith('pd-') && disk.sourceImage === undefined); + const diskWithoutImage = disks.find( + (disk) => (disk.type.startsWith('pd-') || disk.type.startsWith('hyperdisk-')) && disk.sourceImage === undefined, + ); return [diskWithoutImage].concat(without(disks, diskWithoutImage)); } @@ -93,7 +95,9 @@ class GceDiskConfigurerController implements IComponentController { } private getPersistentDisks(): IGceDisk[] { - return (this.command.disks || []).filter((disk: IGceDisk) => disk.type.startsWith('pd-')); + return (this.command.disks || []).filter( + (disk: IGceDisk) => disk.type.startsWith('pd-') || disk.type.startsWith('hyperdisk-'), + ); } }