@@ -467,15 +467,37 @@ func TestExtractAndDefaultParameters(t *testing.T) {
467
467
},
468
468
},
469
469
{
470
- name : "useAllowedDiskTopology specified, disk topology feature disabled" ,
471
- parameters : map [string ]string {ParameterKeyUseAllowedDiskTopology : "foo-bar" },
472
- expectErr : true ,
470
+ // Disk topology feature shouldn't cause parameter parsing to fail, even when misconfigured.
471
+ name : "useAllowedDiskTopology specified, disk topology feature disabled" ,
472
+ parameters : map [string ]string {
473
+ ParameterKeyUseAllowedDiskTopology : "true" , // Correct type: boolean string.
474
+ },
475
+ labels : map [string ]string {},
476
+ expectParams : DiskParameters {
477
+ DiskType : "pd-standard" ,
478
+ ReplicationType : "none" ,
479
+ DiskEncryptionKMSKey : "" ,
480
+ Tags : map [string ]string {},
481
+ Labels : map [string ]string {},
482
+ ResourceTags : map [string ]string {},
483
+ },
473
484
},
474
485
{
486
+ // Disk topology feature shouldn't cause parameter parsing to fail, even when misconfigured.
475
487
name : "useAllowedDiskTopology specified, wrong type" ,
476
- parameters : map [string ]string {ParameterKeyUseAllowedDiskTopology : "123" },
477
488
enableDiskTopology : true ,
478
- expectErr : true ,
489
+ parameters : map [string ]string {
490
+ ParameterKeyUseAllowedDiskTopology : "123" , // Incorrect type: number.
491
+ },
492
+ labels : map [string ]string {},
493
+ expectParams : DiskParameters {
494
+ DiskType : "pd-standard" ,
495
+ ReplicationType : "none" ,
496
+ DiskEncryptionKMSKey : "" ,
497
+ Tags : map [string ]string {},
498
+ Labels : map [string ]string {},
499
+ ResourceTags : map [string ]string {},
500
+ },
479
501
},
480
502
{
481
503
name : "useAllowedDiskTopology specified as valid true boolean" ,
0 commit comments