Skip to content

Commit

Permalink
feat(gce): add support for hyperdisk in GCE (#10149)
Browse files Browse the repository at this point in the history
* test(gce): add hyperdisk-balanced in defaults for testing

* Revert "test(gce): add hyperdisk-balanced in defaults for testing"

This reverts commit a1b160b.

* 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 c4ca6f2.
  • Loading branch information
edgarulg authored Oct 4, 2024
1 parent 363a768 commit 14977d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -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-'),
);
}
}

Expand Down

0 comments on commit 14977d1

Please sign in to comment.