Skip to content

Commit

Permalink
Merge pull request #63 from F5Networks/devel_fixes_29082024
Browse files Browse the repository at this point in the history
fix tenant deletion issue in failed deployments
  • Loading branch information
RavinderReddyF5 authored Aug 29, 2024
2 parents 4d4b5dd + 484c0b8 commit 1ec3418
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 1ec3418

Please sign in to comment.