Skip to content

Commit

Permalink
optional pc fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jaylevin committed Oct 1, 2024
1 parent b6d8d8e commit 6582bf4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions internal/clients/confluent.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,21 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string, sche
}

// Set credentials in Terraform provider configuration.
ps.Configuration = map[string]any{
cloudAPIKey: creds[cloudAPIKey],
cloudAPISecret: creds[cloudAPISecret],
ps.Configuration = map[string]any{}
if cloudAPIKey, ok := creds[cloudAPIKey]; ok {
ps.Configuration[cloudAPIKey] = creds[cloudAPIKey]
}
if cloudAPISecret, ok := creds[cloudAPISecret]; ok {
ps.Configuration[cloudAPISecret] = creds[cloudAPISecret]
}

if kafkaAPIKey, ok := creds[kafkaAPIKey]; ok {
ps.Configuration[kafkaAPIKey] = creds[kafkaAPIKey],
ps.Configuration[kafkaAPIKey] = creds[kafkaAPIKey]
}
if kafkaAPISecret, ok := creds[kafkaAPISecret]; ok {
ps.Configuration[kafkaAPISecret] = creds[kafkaAPISecret],
ps.Configuration[kafkaAPISecret] = creds[kafkaAPISecret]
}
if kafkaRESTEndpoint, ok := creds[kafkaRESTEndpoint]; ok {
ps.Configuration[kafkaRESTEndpoint] = creds[kafkaRESTEndpoint],
ps.Configuration[kafkaRESTEndpoint] = creds[kafkaRESTEndpoint]
}
return ps, nil
}
Expand Down

0 comments on commit 6582bf4

Please sign in to comment.