Skip to content

Commit

Permalink
fix: Fixes tag extracting
Browse files Browse the repository at this point in the history
  • Loading branch information
salehkhazaei committed Aug 29, 2024
1 parent 2520d45 commit de91fe0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/steampipe/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ func ExtractTagsAndNames(plg *plugin.Plugin, logger *zap.Logger, pluginTableName
tags[tk] = ts
} else if ts, ok := tv.(bool); ok {
tags[tk] = fmt.Sprintf("%v", ts)
} else if ts, ok := tv.([]interface{}); ok {
out, _ := json.Marshal(ts)
tags[tk] = string(out)
} else {
if logger != nil {
logger.Error("Invalid tags value type", zap.String("resourceType", resourceType), zap.Any("valueType", reflect.TypeOf(tv)), zap.Any("value", tv))
}
return nil, "", fmt.Errorf("invalid tags value type: %s", reflect.TypeOf(tv))
//return tags, "", fmt.Errorf("invalid tags value type: %s", reflect.TypeOf(tv))
}
}
} else if tarr, ok := t.([]interface{}); ok {
Expand All @@ -90,7 +93,7 @@ func ExtractTagsAndNames(plg *plugin.Plugin, logger *zap.Logger, pluginTableName
if logger != nil {
logger.Error("Invalid tags js value type", zap.String("resourceType", resourceType), zap.Any("valueType", reflect.TypeOf(tv)), zap.Any("value", tv))
}
return nil, "", fmt.Errorf("invalid tags js value type: %s", reflect.TypeOf(tv))
//return nil, "", fmt.Errorf("invalid tags js value type: %s", reflect.TypeOf(tv))
}
}
}
Expand Down

0 comments on commit de91fe0

Please sign in to comment.