From 462072d1001907321132acbeb3daea8996738835 Mon Sep 17 00:00:00 2001 From: barbacbd Date: Thu, 29 Jan 2026 14:38:04 -0500 Subject: [PATCH] OCPBUGS-74390: Allow all instance types in the install config for GCP ** validation.go: Correct the error message to provide all supported instance types when one is not found. ** machinepools.go Update the map to include all instance types and the supported disk types. The unsupported disk types are in comments in the map. These are to be updated when/if openshift supports these disktypes in the future. --- pkg/asset/installconfig/gcp/validation.go | 6 +-- pkg/types/gcp/machinepools.go | 53 ++++++++++++++++------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/pkg/asset/installconfig/gcp/validation.go b/pkg/asset/installconfig/gcp/validation.go index 4de7752385..e2ca683108 100644 --- a/pkg/asset/installconfig/gcp/validation.go +++ b/pkg/asset/installconfig/gcp/validation.go @@ -91,12 +91,12 @@ func validateInstanceAndDiskType(fldPath *field.Path, diskType, instanceType, ar } diskTypes, ok := gcp.InstanceTypeToDiskTypeMap[family] if !ok { - return field.NotFound(fldPath.Child("type"), family) + logrus.Warnf("unrecognized instance type %s with family %s", instanceType, family) } - acceptedArmFamilies := sets.New("c4a", "n4a", "t2a") + acceptedArmFamilies := sets.New("c4a", "n4a", "t2a", "a4x") if arch == types.ArchitectureARM64 && !acceptedArmFamilies.Has(family) { - return field.NotSupported(fldPath.Child("type"), family, sets.List(acceptedArmFamilies)) + logrus.Warnf("unrecognized instance type %s with arm architecture family %s", instanceType, family) } if diskType != "" { diff --git a/pkg/types/gcp/machinepools.go b/pkg/types/gcp/machinepools.go index 3ee22bae81..1af5d1fd1c 100644 --- a/pkg/types/gcp/machinepools.go +++ b/pkg/types/gcp/machinepools.go @@ -37,24 +37,45 @@ var ( // InstanceTypeToDiskTypeMap contains a map where the key is the Instance Type, and the // values are a list of disk types that are supported by the installer and correlate to the Instance Type. InstanceTypeToDiskTypeMap = map[string][]string{ - "a2": {PDStandard, PDSSD, PDBalanced}, - "a3": {PDSSD, PDBalanced}, - "c2": {PDStandard, PDSSD, PDBalanced}, - "c2d": {PDStandard, PDSSD, PDBalanced}, - "c3": {PDSSD, PDBalanced, HyperDiskBalanced}, - "c3d": {PDSSD, PDBalanced, HyperDiskBalanced}, - "c4": {HyperDiskBalanced}, - "c4a": {HyperDiskBalanced}, - "e2": {PDStandard, PDSSD, PDBalanced}, - "g2": {PDStandard, PDSSD, PDBalanced}, - "m1": {PDSSD, PDBalanced, HyperDiskBalanced}, + // General Purpose Machine Family + "c4d": {HyperDiskBalanced}, // unsupported: hyperdisk-extreme + "c4": {HyperDiskBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, hyperdisk-balanced-high-availability + "c4a": {HyperDiskBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, hyperdisk-balanced-high-availability, hyperdisk-ml + "c3": {PDSSD, PDBalanced, HyperDiskBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, hyperdisk-balanced-high-availability, hyperdisk-ml + "c3d": {PDSSD, PDBalanced, HyperDiskBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, hyperdisk-balanced-high-availability, hyperdisk-ml + "n4": {HyperDiskBalanced}, // unsupported: hyperdisk-throughput, hyperdisk-balanced-high-availability + "n4a": {HyperDiskBalanced}, // unsupported: hyperdisk-throughput, hyperdisk-balanced-high-availability + "n4d": {HyperDiskBalanced}, // unsupported: hyperdisk-throughput, hyperdisk-balanced-high-availability + "n2": {PDStandard, PDSSD, PDBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, pd-extreme + "n2d": {PDStandard, PDSSD, PDBalanced}, // unsupported: hyperdisk-throughput "n1": {PDStandard, PDSSD, PDBalanced}, - "n2": {PDStandard, PDSSD, PDBalanced}, - "n2d": {PDStandard, PDSSD, PDBalanced}, - "n4": {HyperDiskBalanced}, - "n4a": {HyperDiskBalanced}, + "e2": {PDStandard, PDSSD, PDBalanced}, "t2a": {PDStandard, PDSSD, PDBalanced}, - "t2d": {PDStandard, PDSSD, PDBalanced}, + "t2d": {PDStandard, PDSSD, PDBalanced}, // unsupported: hyperdisk-throughput + + // Storage Optimized Machine Family + "z3": {PDBalanced, PDSSD, HyperDiskBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, hyperdisk-balanced-high-availability + + // Compute Optimized Machine Family + "h4d": {HyperDiskBalanced}, + "h3": {PDBalanced, HyperDiskBalanced}, // unsupported: hyperdisk-throughput + "c2": {PDStandard, PDSSD, PDBalanced}, + "c2d": {PDStandard, PDSSD, PDBalanced}, + + // Memory Optimized Machine Family + "x4": {HyperDiskBalanced}, // unsupported: hyperdisk-extreme + "m4": {HyperDiskBalanced}, // unsupported: hyperdisk-extreme + "m3": {PDSSD, PDBalanced, HyperDiskBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, hyperdisk-balanced-high-availability, pd-extreme + "m2": {PDSSD, PDBalanced, HyperDiskBalanced}, // unsupported: hyperdisk-extreme, pd-extreme + "m1": {PDSSD, PDBalanced, HyperDiskBalanced}, // unsupported: hyperdisk-extreme, pd-extreme + + // Accelerator Optimized Machine Family + "a4x": {HyperDiskBalanced}, // unsupported: hyperdisk-balanced-high-availability + "a4": {HyperDiskBalanced}, // unsupported: hyperdisk-extreme + "a3": {PDSSD, PDBalanced}, // unsupported: hyperdisk-balanced-high-availability, hyperdisk-extreme + "a2": {PDStandard, PDSSD, PDBalanced}, // unsupported: hyperdisk-ml + "g4": {HyperDiskBalanced}, // unsupported: hyperdisk-extreme, hyperdisk-throughput, hyperdisk-balanced-high-availability + "g2": {PDStandard, PDSSD, PDBalanced}, // unsupported: hyperdisk-ml, hyperdisk-throughput } )