Skip to content

Commit

Permalink
Update pkg/list/list_components.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
pkbhowmick and coderabbitai[bot] authored Dec 8, 2024
1 parent a3fec3d commit d192dcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/list/list_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ func getStackComponents(stackData any, listFields []string) ([]string, error) {

for _, dataKey := range uniqueKeys {
data := terraformComponents[dataKey]
dataMap, ok := data.(map[string]any)
if !ok {
return nil, fmt.Errorf("unexpected data type for component '%s'", dataKey)
}
rowData := make([]string, 0)
for _, key := range listFields {
value, found := resolveKey(data.(map[string]any), key)
value, found := resolveKey(dataMap, key)
if !found {
value = "-"
}
Expand Down

0 comments on commit d192dcf

Please sign in to comment.