Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tools/baseimage/cmd/gce_install_cuttlefish_packages/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ func main() {
}

buildImageOpts := gce.BuildImageOpts{
Arch: arch.GceArch(),
SourceImageProject: sourceImageProject,
SourceImage: sourceImage,
ImageName: imageName,
Arch: arch.GceArch(),
SourceImageProject: sourceImageProject,
SourceImage: sourceImage,
ImageName: imageName,
CreateAttachedDiskOpts: gce.CreateDiskOpts{SizeGb: 32},
ModifyFunc: func(project, zone, insName string) error {
dstSrcs := []string{}
for _, src := range debSrcs.Srcs {
Expand Down
13 changes: 7 additions & 6 deletions tools/baseimage/pkg/gce/gce.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,12 @@ func (h *GceHelper) CreateImage(ins, disk, name string) error {
}

type BuildImageOpts struct {
Arch Arch
SourceImageProject string
SourceImage string
ImageName string
ModifyFunc func(project, zone, insName string) error
Arch Arch
SourceImageProject string
SourceImage string
ImageName string
CreateAttachedDiskOpts CreateDiskOpts
ModifyFunc func(project, zone, insName string) error
}

const BuildImageMountPoint = "/mnt/image"
Expand All @@ -239,7 +240,7 @@ func (h *GceHelper) BuildImage(project, zone string, opts BuildImageOpts) error
attachedDiskName := fmt.Sprintf("%s-attached-disk", insName)

log.Println("creating disk...")
if _, err := h.CreateDisk(opts.SourceImageProject, opts.SourceImage, attachedDiskName, CreateDiskOpts{}); err != nil {
if _, err := h.CreateDisk(opts.SourceImageProject, opts.SourceImage, attachedDiskName, opts.CreateAttachedDiskOpts); err != nil {
return fmt.Errorf("failed to create disk: %w", err)
}
defer h.cleanupDeleteDisk(attachedDiskName)
Expand Down
Loading