From b06d2c461cfa13ce408eab784efb309f5a204bfc Mon Sep 17 00:00:00 2001 From: Fabian Fulga Date: Tue, 24 Sep 2024 15:23:52 +0300 Subject: [PATCH] Fix issue when DiskType is not set --- internal/client/gcp.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/client/gcp.go b/internal/client/gcp.go index 4201b09..3c369ba 100644 --- a/internal/client/gcp.go +++ b/internal/client/gcp.go @@ -324,7 +324,6 @@ func generateBootDisk(diskSize int64, image, snapshot string, diskType string, c Boot: proto.Bool(true), InitializeParams: &computepb.AttachedDiskInitializeParams{ DiskSizeGb: proto.Int64(diskSize), - DiskType: proto.String(diskType), Labels: customLabels, SourceImage: proto.String(image), SourceSnapshot: proto.String(snapshot), @@ -333,6 +332,10 @@ func generateBootDisk(diskSize int64, image, snapshot string, diskType string, c }, } + if diskType != "" { + disk[0].InitializeParams.DiskType = proto.String(diskType) + } + if snapshot != "" { disk[0].InitializeParams.SourceImage = nil }