Merge pull request #3 from cgroschupp/master

return error in clusterCreate
This commit is contained in:
Conor Mongey
2020-01-09 17:03:06 +00:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ func Provider() terraform.ResourceProvider {
}
func providerConfigure(d *schema.ResourceData) (interface{}, error) {
log.Printf("[INFO] Initializing KafkaConnect client")
log.Printf("[INFO] Initializing ConfluentCloud client")
username := d.Get("username").(string)
password := d.Get("password").(string)
c := confluentcloud.NewClient(username, password)
+4 -2
View File
@@ -80,10 +80,12 @@ func clusterCreate(d *schema.ResourceData, meta interface{}) error {
}
cluster, err := c.CreateCluster(req)
if err == nil {
d.SetId(cluster.ID)
if err != nil {
return err
}
d.SetId(cluster.ID)
return nil
}