Skip to content

Commit

Permalink
chore: restore comopnent order and clarification-request
Browse files Browse the repository at this point in the history
  • Loading branch information
iru committed Feb 21, 2024
1 parent de5c714 commit b8c9990
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions sysdig/resource_sysdig_secure_cloud_auth_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,15 @@ func componentsToResourceData(components []*cloudauth.AccountComponent, dataComp

if len(allComponents) > 0 {

//if len(dataComponentsOrder) > 0 {
// // add the component blocks in same order to maintain ordering
// for _, c := range dataComponentsOrder {
// componentItem := allComponents[c].(map[string]interface{})
// componentsList = append(componentsList, componentItem)
// }
// return componentsList
//}
// add the component blocks in same order to maintain ordering
// note-request; why is this needed?
if len(dataComponentsOrder) > 0 {
for _, c := range dataComponentsOrder {
componentItem := allComponents[c].(map[string]interface{})
componentsList = append(componentsList, componentItem)
}
return componentsList
}

// if no ordering is provided, return all components in any order
for _, c := range allComponents {
Expand Down

0 comments on commit b8c9990

Please sign in to comment.