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

feat(gce): add support for hyperdisk in GCE #10149

Merged
merged 9 commits into from
Oct 4, 2024
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
Loading