(baseDir string, conf map[string]interface{}, id string)
| 264 | } |
| 265 | |
| 266 | func findConfiguredAgentByID(baseDir string, conf map[string]interface{}, id string) (dto.AgentConfiguredAgentItem, bool) { |
| 267 | agents, ok := conf["agents"].(map[string]interface{}) |
| 268 | if !ok { |
| 269 | return dto.AgentConfiguredAgentItem{}, false |
| 270 | } |
| 271 | rawList, ok := agents["list"].([]interface{}) |
| 272 | if !ok { |
| 273 | return dto.AgentConfiguredAgentItem{}, false |
| 274 | } |
| 275 | for _, item := range rawList { |
| 276 | record, ok := item.(map[string]interface{}) |
| 277 | if !ok { |
| 278 | continue |
| 279 | } |
| 280 | configured := extractConfiguredAgentItem(baseDir, record) |
| 281 | if strings.EqualFold(configured.ID, id) { |
| 282 | return configured, true |
| 283 | } |
| 284 | } |
| 285 | return dto.AgentConfiguredAgentItem{}, false |
| 286 | } |
| 287 | |
| 288 | func formatRoleBinding(channel, accountID string) string { |
| 289 | if channel == "" { |
no test coverage detected