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

@@ -83,7 +83,7 @@ func (r *resourceLB) Create(ctx context.Context, req resource.CreateRequest, res
// framework would mark resource as tainted and delete it, which would be unwanted behaviour.
// enable or disable lb, warnings added to resp.Diagnostics in case of failure.
if !plan.Enable.IsNull() { // Enable is optional
if !plan.Enable.ValueBool() { // Enable is optional
diags := utilities.LBEnableDisable(ctx, &plan, r.client)
for _, d := range diags {
if d.Severity() == diag.SeverityError {
@@ -307,17 +307,10 @@ func (r *resourceLB) Delete(ctx context.Context, req resource.DeleteRequest, res
ctx, cancel := context.WithTimeout(ctx, readTimeout)
defer cancel()
var permanently bool
if state.Permanently.IsNull() {
permanently = true
} else {
permanently = state.Permanently.ValueBool()
}
// Delete existing lb
delReq := lb.DeleteRequest{
LBID: uint64(state.LBID.ValueInt64()),
Permanently: permanently,
Permanently: state.Permanently.ValueBool(),
}
tflog.Info(ctx, "Delete resourceLB: calling CloudAPI().LB().Delete", map[string]any{