@@ -117,20 +117,21 @@ func updateAuditDoc(doc []byte, auditableResourcesMap AuditableResourcesMap) ([]
117
117
buffer .WriteString ("|--|-----------------|\n " )
118
118
119
119
for _ , resourceName := range sortedResourceNames {
120
+ readableResourceName := resourceName
121
+ // AuditableGroup is really a combination of Group and GroupMember resources
122
+ // but we use the label 'Group' in our docs to avoid confusion.
123
+ if resourceName == "AuditableGroup" {
124
+ readableResourceName = "Group"
125
+ }
126
+
120
127
// Create a string of audit actions for each resource
121
128
var auditActions []string
122
- for _ , action := range audit .AuditActionMap [resourceName ] {
129
+ for _ , action := range audit .AuditActionMap [readableResourceName ] {
123
130
auditActions = append (auditActions , string (action ))
124
131
}
125
132
auditActionsString := strings .Join (auditActions , ", " )
126
133
127
- // AuditableGroup is really a combination of Group and GroupMember resources
128
- // but we use the label 'Group' in our docs to avoid confusion.
129
- if resourceName == "AuditableGroup" {
130
- resourceName = "Group"
131
- }
132
-
133
- buffer .WriteString ("|" + resourceName + "<br><i>" + auditActionsString + "</i>|<table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody>" )
134
+ buffer .WriteString ("|" + readableResourceName + "<br><i>" + auditActionsString + "</i>|<table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody>" )
134
135
135
136
// We must sort the field names to ensure sub-table ordering
136
137
sortedFieldNames := sortKeys (auditableResourcesMap [resourceName ])
0 commit comments