Skip to content

Commit

Permalink
fix tenant deletion issue in failed deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
RavinderReddyF5 committed Aug 28, 2024
1 parent 4d4b5dd commit 484c0b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/provider/tenant_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (r *TenantResource) Create(ctx context.Context, req resource.CreateRequest,
teemInfo := make(map[string]interface{})
teemInfo["teemData"] = r.teemData
r.client.Metadata = teemInfo
_ = r.client.SendTeem(teemInfo)
// _ = r.client.SendTeem(teemInfo)
// if err != nil {
// resp.Diagnostics.AddError("Teem Error", fmt.Sprintf("Sending Teem Data failed: %s", err))
// }
Expand All @@ -270,7 +270,11 @@ func (r *TenantResource) Create(ctx context.Context, req resource.CreateRequest,
stop <- true
return
}
// _ = r.client.DeleteTenant(data.Name.ValueString())
if strings.Contains(err.Error(), "object already exists") {
stop <- true
return
}
_ = r.client.DeleteTenant(data.Name.ValueString())
stop <- true
return
}
Expand Down

0 comments on commit 484c0b8

Please sign in to comment.