@@ -223,7 +223,7 @@ func nameRequiresDeleteBeforeReplace(news resource.PropertyMap, olds resource.Pr
223
223
if len (resourceInfo .UniqueNameFields ) > 0 {
224
224
for _ , name := range resourceInfo .UniqueNameFields {
225
225
key := resource .PropertyKey (name )
226
- _ , _ , psi := getInfoFromPulumiName (key , tfs , fields , false )
226
+ _ , _ , psi := getInfoFromPulumiName (key , tfs , fields )
227
227
228
228
oldVal := olds [key ]
229
229
newVal := news [key ]
@@ -241,7 +241,7 @@ func nameRequiresDeleteBeforeReplace(news resource.PropertyMap, olds resource.Pr
241
241
}
242
242
243
243
for key := range news {
244
- _ , _ , psi := getInfoFromPulumiName (key , tfs , fields , false )
244
+ _ , _ , psi := getInfoFromPulumiName (key , tfs , fields )
245
245
if psi != nil && psi .HasDefault () && psi .Default .AutoNamed && ! hasDefault [key ] {
246
246
return true
247
247
}
@@ -591,7 +591,7 @@ func (ctx *conversionContext) makeObjectTerraformInputs(
591
591
}
592
592
593
593
// First translate the Pulumi property name to a Terraform name.
594
- name , tfi , psi := getInfoFromPulumiName (key , tfs , ps , false )
594
+ name , tfi , psi := getInfoFromPulumiName (key , tfs , ps )
595
595
contract .Assertf (name != "" , `Object properties cannot be empty` )
596
596
597
597
if _ , duplicate := result [name ]; duplicate {
@@ -1383,7 +1383,7 @@ func getInfoFromTerraformName(key string,
1383
1383
1384
1384
// getInfoFromPulumiName does a reverse map lookup to find the Terraform name and schema info for a Pulumi name, if any.
1385
1385
func getInfoFromPulumiName (key resource.PropertyKey ,
1386
- tfs shim.SchemaMap , ps map [string ]* SchemaInfo , rawName bool ) (string ,
1386
+ tfs shim.SchemaMap , ps map [string ]* SchemaInfo ) (string ,
1387
1387
shim.Schema , * SchemaInfo ) {
1388
1388
// To do this, we will first look to see if there's a known custom schema that uses this name. If yes, we
1389
1389
// prefer to use that. To do this, we must use a reverse lookup. (In the future we may want to make a
@@ -1394,14 +1394,10 @@ func getInfoFromPulumiName(key resource.PropertyKey,
1394
1394
return tfname , getSchema (tfs , tfname ), schinfo
1395
1395
}
1396
1396
}
1397
- var name string
1398
- if rawName {
1399
- // If raw names are requested, they will not have been mangled, so preserve the name as-is.
1400
- name = ks
1401
- } else {
1402
- // Otherwise, transform the Pulumi name to the Terraform name using the standard mangling scheme.
1403
- name = PulumiToTerraformName (ks , tfs , ps )
1404
- }
1397
+
1398
+ // transform the Pulumi name to the Terraform name using the standard mangling scheme.
1399
+ name := PulumiToTerraformName (ks , tfs , ps )
1400
+
1405
1401
return name , getSchema (tfs , name ), ps [name ]
1406
1402
}
1407
1403
@@ -1565,7 +1561,7 @@ func extractInputsObject(
1565
1561
for name , oldValue := range oldInput {
1566
1562
defaultElem := false
1567
1563
if newValue , ok := newState [name ]; ok {
1568
- _ , etfs , eps := getInfoFromPulumiName (name , tfs , ps , false )
1564
+ _ , etfs , eps := getInfoFromPulumiName (name , tfs , ps )
1569
1565
oldInput [name ], defaultElem = extractInputs (oldValue , newValue , etfs , eps )
1570
1566
} else {
1571
1567
delete (oldInput , name )
@@ -1729,7 +1725,7 @@ func extractSchemaInputsObject(
1729
1725
) resource.PropertyMap {
1730
1726
v := make (map [resource.PropertyKey ]resource.PropertyValue , len (state ))
1731
1727
for k , e := range state {
1732
- _ , etfs , eps := getInfoFromPulumiName (k , tfs , ps , false )
1728
+ _ , etfs , eps := getInfoFromPulumiName (k , tfs , ps )
1733
1729
typeKnown := tfs != nil && etfs != nil
1734
1730
1735
1731
// We drop fields that are not present in the schema.
0 commit comments