Merge pull request #1139 from cloudskiff/fix/providerConfigure
Run provider gRPC configure anywaymain
commit
91145d888f
|
@ -111,19 +111,23 @@ func (p *TerraformProvider) configure(alias string) error {
|
|||
p.schemas = schema.ResourceTypes
|
||||
}
|
||||
|
||||
// This value is optional. It'll be overridden by the provider config.
|
||||
config := cty.NullVal(cty.DynamicPseudoType)
|
||||
|
||||
if p.Config.GetProviderConfig != nil {
|
||||
configType := schema.Provider.Block.ImpliedType()
|
||||
val, err := gocty.ToCtyValue(p.Config.GetProviderConfig(alias), configType)
|
||||
config, err = gocty.ToCtyValue(p.Config.GetProviderConfig(alias), configType)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
resp := p.grpcProviders[alias].Configure(providers.ConfigureRequest{
|
||||
Config: val,
|
||||
Config: config,
|
||||
})
|
||||
if resp.Diagnostics.HasErrors() {
|
||||
return resp.Diagnostics.Err()
|
||||
}
|
||||
}
|
||||
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"alias": alias,
|
||||
|
|
Loading…
Reference in New Issue