Skip to content

Generate boot disk name from image name instead of ID #2476

@david-crespo

Description

@david-crespo

abc-ae46ddf5-a8d5-40fa-bcda-fca-71c32d is not the most useful name. We could stick "silo" or "project" in there to mark whether it was a silo or project image, but that would probably be more confusing than not. We already have the generated random part to avoid name collisions.

const getBootDiskAttachment = (values: InstanceCreateInput): InstanceDiskAttachment => {
if (values.bootDiskSourceType === 'disk') {
return { type: 'attach', name: values.diskSource }
}
const source =
values.bootDiskSourceType === 'siloImage'
? values.siloImageSource
: values.projectImageSource
return {
type: 'create',
name: values.bootDiskName || genName(values.name, source),
description: `Created as a boot disk for ${values.name}`,
size: values.bootDiskSize * GiB,
diskSource: { type: 'image', imageId: source },
}
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions