Skip to content

Commit

Permalink
Removes checks for unknown API keys (#13)
Browse files Browse the repository at this point in the history
Unknown values occur when API keys are read from other resources in Terraform,
e.g. AWS secrets manager so these checks block such dependency setups.

Bad or missing API keys are still caught and handled when the API is called.
  • Loading branch information
robnorman committed Jun 1, 2023
1 parent 5d91e78 commit 4367711
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,28 +178,6 @@ func (p *singlestoreProvider) ValidateConfig(ctx context.Context, req provider.V
return
}

if conf.APIKey.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root(config.APIKeyAttribute),
"Unknown API key",
"The provider cannot create the Management API client as there is an unknown configuration value for the API key. "+
config.InvalidAPIKeyErrorDetail,
)

return
}

if conf.APIKeyPath.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root(config.APIKeyPathAttribute),
"Unknown API key path",
"The provider cannot create the Management API client as there is an unknown configuration value for the API key path. "+
config.InvalidAPIKeyErrorDetail,
)

return
}

if conf.APIServiceURL.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root(config.APIServiceURLAttribute),
Expand Down

0 comments on commit 4367711

Please sign in to comment.