fix: try fix errors
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 6s
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 6s
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
This commit is contained in:
parent
1451273760
commit
f83fe3b30b
10 changed files with 137 additions and 243 deletions
|
|
@ -11,7 +11,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-framework/attr"
|
||||
"github.com/hashicorp/terraform-plugin-framework/path"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource/identityschema"
|
||||
|
|
@ -108,37 +107,25 @@ func (r *userResource) ModifyPlan(
|
|||
return
|
||||
}
|
||||
|
||||
// TODO: verify if this is needed - START
|
||||
var configRoles []string
|
||||
diags := configModel.Roles.ElementsAs(ctx, &configRoles, false)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if diags.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
var planRoles []string
|
||||
diags = planModel.Roles.ElementsAs(ctx, &planRoles, false)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if diags.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
slices.Sort(configRoles)
|
||||
slices.Sort(planRoles)
|
||||
|
||||
if !slices.Equal(configRoles, planRoles) {
|
||||
var roles []attr.Value
|
||||
for _, role := range configRoles {
|
||||
roles = append(roles, types.StringValue(string(role)))
|
||||
}
|
||||
rolesSet, diags := types.SetValue(types.StringType, roles)
|
||||
resp.Diagnostics.Append(diags...)
|
||||
if diags.HasError() {
|
||||
return
|
||||
}
|
||||
planModel.Roles = types.List(rolesSet)
|
||||
}
|
||||
// TODO: verify if this is needed - END
|
||||
//// TODO: verify if this is needed - START
|
||||
//var planRoles []string
|
||||
//diags := planModel.Roles.ElementsAs(ctx, &planRoles, false)
|
||||
//resp.Diagnostics.Append(diags...)
|
||||
//if diags.HasError() {
|
||||
// return
|
||||
//}
|
||||
//slices.Sort(planRoles)
|
||||
//var roles []attr.Value
|
||||
//for _, role := range planRoles {
|
||||
// roles = append(roles, types.StringValue(string(role)))
|
||||
//}
|
||||
//rolesSet, diags := types.ListValue(types.StringType, roles)
|
||||
//resp.Diagnostics.Append(diags...)
|
||||
//if diags.HasError() {
|
||||
// return
|
||||
//}
|
||||
//planModel.Roles = rolesSet
|
||||
//// TODO: verify if this is needed - END
|
||||
|
||||
resp.Diagnostics.Append(resp.Plan.Set(ctx, planModel)...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue