File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1515package proto
1616
1717import (
18- "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
18+ // "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
1919
2020 shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
2121)
@@ -36,8 +36,16 @@ func (pseudoResource) DecodeTimeouts(config shim.ResourceConfig) (*shim.Resource
3636func getSchemaMap [T any ](m interface {
3737 GetOk (string ) (T , bool )
3838}, key string ) T {
39- v , ok := m .GetOk (key )
40- contract .Assertf (ok , "Could not find key %q" , key )
39+ v , _ := m .GetOk (key )
40+ // Some functions (such as terraformToPulumiName; link: [1]) do not correctly use
41+ // GetOk, so we can't panic on Get for a missing value, even though that is the
42+ // point of Get.
43+ //
44+ // [^1]: https://github.com/pulumi/pulumi-terraform-bridge/blob/08338be75eedce29c4c2349109d72edc8a38930d/pkg/tfbridge/names.go#L154-L158
45+ //
46+ // contract.Assertf(ok, "Could not find key %q", key)
47+ //
48+ //nolint:lll
4149 return v
4250}
4351
Original file line number Diff line number Diff line change @@ -197,6 +197,16 @@ func (p *provider) validateProviderConfig(
197197 if k == "version" || k == "pluginDownloadURL" {
198198 continue
199199 }
200+ // TODO[https://github.com/pulumi/pulumi/issues/16757] While #16757 is
201+ // outstanding, we need to filter out the keys for parameterized providers
202+ // from the top level namespace.
203+ //
204+ // We will need to remove this check before we GA dynamic providers.
205+ if p .parameterize != nil {
206+ if k == "name" || k == "parameterization" {
207+ continue
208+ }
209+ }
200210 n := tfbridge .PulumiToTerraformName (string (k ), p .schemaOnlyProvider .Schema (), p .info .GetConfig ())
201211 _ , known := p .configType .AttributeTypes [n ]
202212 if ! known {
You can’t perform that action at this time.
0 commit comments