This commit is contained in:
asteam
2024-12-04 13:18:58 +03:00
parent 003e4d656e
commit 76ea459b3d
417 changed files with 30051 additions and 975 deletions

View File

@@ -237,13 +237,6 @@ func (r *resourceRG) Update(ctx context.Context, req resource.UpdateRequest, res
// Validate if changes in plan are allowed
tflog.Info(ctx, "Update resourceRG: checking def_net is not empty in case of change", map[string]any{
"rg_id": state.Id.ValueString()})
if !state.DefNet.IsNull() && plan.DefNet.IsNull() {
resp.Diagnostics.AddError(
"Update resourceRG: Invalid input provided",
fmt.Sprintf("block def_net must not be empty for resource with rg_id %d", recordRG.ID),
)
return
}
tflog.Info(ctx, "Update resourceRG: checking def_net_type, ipcidr, ext_ip are not changed", map[string]any{
"rg_id": state.Id.ValueString(),
@@ -370,9 +363,6 @@ func (r *resourceRG) Delete(ctx context.Context, req resource.DeleteRequest, res
} else {
delReq.Permanently = state.Permanently.ValueBool()
}
if !state.Reason.IsNull() {
delReq.Reason = state.Reason.ValueString()
}
_, err := r.client.CloudAPI().RG().Delete(ctx, delReq)
if err != nil {
resp.Diagnostics.AddError("Delete resourceRG: Error deleting resource group with error: ", err.Error())