(spaceSummary v7action.SpaceSummary)
| 115 | } |
| 116 | |
| 117 | func collectSecurityGroupRuleRows(spaceSummary v7action.SpaceSummary) [][]string { |
| 118 | var rows [][]string |
| 119 | |
| 120 | for _, securityGroup := range spaceSummary.RunningSecurityGroups { |
| 121 | for _, rule := range securityGroup.Rules { |
| 122 | rows = append(rows, []string{ |
| 123 | securityGroup.Name, |
| 124 | rule.Destination, |
| 125 | nilStringPointer(rule.Ports), |
| 126 | rule.Protocol, |
| 127 | "running", |
| 128 | nilStringPointer(rule.Description), |
| 129 | }) |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | for _, securityGroup := range spaceSummary.StagingSecurityGroups { |
| 134 | for _, rule := range securityGroup.Rules { |
| 135 | rows = append(rows, []string{ |
| 136 | securityGroup.Name, |
| 137 | rule.Destination, |
| 138 | nilStringPointer(rule.Ports), |
| 139 | rule.Protocol, |
| 140 | "staging", |
| 141 | nilStringPointer(rule.Description), |
| 142 | }) |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | return rows |
| 147 | } |
| 148 | |
| 149 | func nilStringPointer(pointer *string) string { |
| 150 | if pointer == nil { |
no test coverage detected