This commit is contained in:
asteam
2025-07-01 13:44:09 +03:00
parent 5382579a5f
commit ddbb12996d
1041 changed files with 2842 additions and 96448 deletions

View File

@@ -92,11 +92,6 @@ func CreateRequestResourceRG(ctx context.Context, plan *models.ResourceRGModel)
if !plan.ExtIP.IsNull() {
createReq.ExtIP = plan.ExtIP.ValueString()
}
if plan.RegisterComputes.IsNull() {
createReq.RegisterComputes = false // default value
} else {
createReq.RegisterComputes = plan.RegisterComputes.ValueBool()
}
return createReq, nil
}
@@ -160,7 +155,7 @@ func DisableRG(ctx context.Context, rgId uint64, plan *models.ResourceRGModel, c
return err
}
// UpdateRG compares plan and state for resource group fields name, description, quota, register_computes.
// UpdateRG compares plan and state for resource group fields name, description, quota.
// If any changes are detected, Update request is performed. If not, no update is performed.
func UpdateRG(ctx context.Context, rgId uint64, plan, state *models.ResourceRGModel, c *client.Client) diag.Diagnostics {
var updateNeeded bool
@@ -188,19 +183,6 @@ func UpdateRG(ctx context.Context, rgId uint64, plan, state *models.ResourceRGMo
updateNeeded = true
}
if !plan.RegisterComputes.Equal(state.RegisterComputes) {
if plan.RegisterComputes.IsNull() {
updateReq.RegisterComputes = false // default value
} else {
updateReq.RegisterComputes = plan.RegisterComputes.ValueBool()
}
tflog.Info(ctx, "utilityUpdateRG: new register_computes specified", map[string]any{
"rg_id": plan.Id.ValueString(),
"register_computes_plan": plan.RegisterComputes.ValueBool(),
"register_computes_state": state.RegisterComputes.ValueBool()})
updateNeeded = true
}
if !plan.UniqPools.Equal(state.UniqPools) {
if plan.UniqPools.IsNull() || len(plan.UniqPools.Elements()) == 0 {
updateReq.ClearUniqPools = true
@@ -214,10 +196,6 @@ func UpdateRG(ctx context.Context, rgId uint64, plan, state *models.ResourceRGMo
}
updateReq.UniqPools = uPoolsList
}
tflog.Info(ctx, "utilityUpdateRG: new register_computes specified", map[string]any{
"rg_id": plan.Id.ValueString(),
"register_computes_plan": plan.RegisterComputes.ValueBool(),
"register_computes_state": state.RegisterComputes.ValueBool()})
updateNeeded = true
}