Improve region details (#90)
* Make client config error message more clear * Add missing log * Add region detail to resource/data source description * Generate docs * Remove resourcemanager using region * Apply changes to MongoDBFlex user * Generate docs * Fix wrong description --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
This commit is contained in:
parent
20f3496242
commit
9d11098102
102 changed files with 200 additions and 193 deletions
|
|
@ -74,11 +74,10 @@ func (d *projectDataSource) Configure(ctx context.Context, req datasource.Config
|
|||
apiClient, err = resourcemanager.NewAPIClient(
|
||||
config.WithCustomAuth(providerData.RoundTripper),
|
||||
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
|
||||
config.WithRegion(providerData.Region),
|
||||
)
|
||||
}
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v", err))
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the data source configuration", err))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,12 +88,11 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR
|
|||
apiClient, err = resourcemanager.NewAPIClient(
|
||||
config.WithCustomAuth(providerData.RoundTripper),
|
||||
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
|
||||
config.WithRegion(providerData.Region),
|
||||
)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v", err))
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue