parent
6555a99a6d
commit
189fa1ece7
16 changed files with 388 additions and 175 deletions
|
|
@ -18,9 +18,8 @@ func ConfigureClient(ctx context.Context, providerData *core.ProviderData, diags
|
|||
}
|
||||
if providerData.MongoDBFlexCustomEndpoint != "" {
|
||||
apiClientConfigOptions = append(apiClientConfigOptions, config.WithEndpoint(providerData.MongoDBFlexCustomEndpoint))
|
||||
} else {
|
||||
apiClientConfigOptions = append(apiClientConfigOptions, config.WithRegion(providerData.GetRegion()))
|
||||
}
|
||||
|
||||
apiClient, err := mongodbflex.NewAPIClient(apiClientConfigOptions...)
|
||||
if err != nil {
|
||||
core.LogAndAddError(ctx, diags, "Error configuring API client", fmt.Sprintf("Configuring client: %v. This is an error related to the provider configuration, not to the resource configuration", err))
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ func TestConfigureClient(t *testing.T) {
|
|||
},
|
||||
expected: func() *mongodbflex.APIClient {
|
||||
apiClient, err := mongodbflex.NewAPIClient(
|
||||
config.WithRegion("eu01"),
|
||||
utils.UserAgentConfigOption(testVersion),
|
||||
)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue