Merge pull request #1139 from cloudskiff/fix/providerConfigure
Run provider gRPC configure anywaymain
commit
91145d888f
|
@ -111,18 +111,22 @@ func (p *TerraformProvider) configure(alias string) error {
|
||||||
p.schemas = schema.ResourceTypes
|
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 {
|
if p.Config.GetProviderConfig != nil {
|
||||||
configType := schema.Provider.Block.ImpliedType()
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
resp := p.grpcProviders[alias].Configure(providers.ConfigureRequest{
|
}
|
||||||
Config: val,
|
|
||||||
})
|
resp := p.grpcProviders[alias].Configure(providers.ConfigureRequest{
|
||||||
if resp.Diagnostics.HasErrors() {
|
Config: config,
|
||||||
return resp.Diagnostics.Err()
|
})
|
||||||
}
|
if resp.Diagnostics.HasErrors() {
|
||||||
|
return resp.Diagnostics.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
logrus.WithFields(logrus.Fields{
|
logrus.WithFields(logrus.Fields{
|
||||||
|
|
Loading…
Reference in New Issue