@@ -3077,29 +3077,41 @@ func TestGetMachineCategory(t *testing.T) {
30773077 want : "a100-40gb-1:GPU,v6e-4:TPU" ,
30783078 },
30793079 {
3080- name : "Handles memory-optimized machine types correctly as CPU" ,
3080+ name : "Handles unknown CPU prefixes securely falling back to CPU via string shapes " ,
30813081 bp : config.Blueprint {
30823082 Groups : []config.Group {
30833083 {
30843084 Name : config .GroupName ("primary" ),
30853085 Modules : []config.Module {
30863086 {
3087- ID : config .ModuleID ("compute_mem_1 " ),
3087+ ID : config .ModuleID ("compute_node_fallback_1 " ),
30883088 Settings : config .NewDict (map [string ]cty.Value {
3089- "machine_type" : cty .StringVal ("m1-megamem-96 " ),
3089+ "machine_type" : cty .StringVal ("z9-standard-8 " ),
30903090 }),
30913091 },
30923092 {
3093- ID : config .ModuleID ("compute_mem_2 " ),
3093+ ID : config .ModuleID ("compute_node_fallback_2 " ),
30943094 Settings : config .NewDict (map [string ]cty.Value {
3095- "machine_type" : cty .StringVal ("m2-ultramem-208" ),
3095+ "machine_type" : cty .StringVal ("q4-highmem-32" ),
3096+ }),
3097+ },
3098+ {
3099+ ID : config .ModuleID ("compute_node_fallback_3" ),
3100+ Settings : config .NewDict (map [string ]cty.Value {
3101+ "machine_type" : cty .StringVal ("p2-highcpu-4" ),
3102+ }),
3103+ },
3104+ {
3105+ ID : config .ModuleID ("compute_node_fallback_4" ),
3106+ Settings : config .NewDict (map [string ]cty.Value {
3107+ "machine_type" : cty .StringVal ("custom-3-4096" ),
30963108 }),
30973109 },
30983110 },
30993111 },
31003112 },
31013113 },
3102- want : "m1-megamem-96 :CPU,m2-ultramem-208 :CPU" ,
3114+ want : "z9-standard-8 :CPU,q4-highmem-32:CPU,p2-highcpu-4:CPU,custom-3-4096 :CPU" ,
31033115 },
31043116 {
31053117 name : "Handles unknown machine types mapped to Other" ,
0 commit comments