Skip to content

Commit

Permalink
Remove unused schema options (#2223)
Browse files Browse the repository at this point in the history
This was missed in
#2049

The code was never used and instead the problem was fixed in
#1971 at the root.

Simplify schema.go a bit as it is complicated enough already.
  • Loading branch information
VenelinMartinov authored Jul 22, 2024
1 parent c57aebd commit c9ce9b5
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pkg/tfbridge/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ type conversionContext struct {
ProviderConfig resource.PropertyMap
ApplyDefaults bool
ApplyTFDefaults bool
ApplyMaxItemsOneDefaults bool
Assets AssetTable
UnknownCollectionsSupported bool
}
Expand Down Expand Up @@ -648,18 +647,6 @@ func (ctx *conversionContext) makeObjectTerraformInputs(
return nil, err
}

if tfs != nil && ctx.ApplyMaxItemsOneDefaults {
// Iterate over the TF schema and add an empty array for each nil MaxItemsOne property.
tfs.Range(func(key string, value shim.Schema) bool {
// First do a lookup of the name/info.
_, tfi, psi := getInfoFromTerraformName(key, tfs, ps, false)
if IsMaxItemsOne(tfi, psi) && result[key] == nil {
result[key] = []interface{}{}
}
return true
})
}

if glog.V(5) {
for k, v := range result {
glog.V(5).Infof("Terraform input %v = %#v", k, v)
Expand Down

0 comments on commit c9ce9b5

Please sign in to comment.