Skip to content

Commit

Permalink
Merge 9d270bf into 5d215c8
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe authored Aug 2, 2023
2 parents 5d215c8 + 9d270bf commit 09fe9f9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/tfbridge/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@ func (ctx *conversionContext) MakeTerraformInput(name string, old, v resource.Pr
case v.IsNull():
return nil, nil
case v.IsBool():
if tfs != nil && tfs.Type() == shim.TypeString {
if v.BoolValue() {
return "true", nil
}
return "false", nil
}
return v.BoolValue(), nil
case v.IsNumber():
if tfs != nil && tfs.Type() == shim.TypeFloat {
Expand Down Expand Up @@ -718,7 +724,12 @@ func (ctx *conversionContext) applyDefaults(result map[string]interface{}, olds,
}
if defaultValue != nil {
glog.V(9).Infof("Created Terraform input: %v = %v (from %s)", name, defaultValue, source)
result[name] = defaultValue
pValue := resource.NewPropertyValue(defaultValue)
tv, err := ctx.MakeTerraformInput(name, resource.PropertyValue{}, pValue, tfi, psi, rawNames)
if err != nil {
return err
}
result[name] = tv
newDefaults = append(newDefaults, key)

// Expand the conflicts and exactlyOneOf map
Expand Down

0 comments on commit 09fe9f9

Please sign in to comment.