(installDir string, record map[string]interface{})
| 239 | } |
| 240 | |
| 241 | func extractConfiguredAgentItem(installDir string, record map[string]interface{}) dto.AgentConfiguredAgentItem { |
| 242 | item := dto.AgentConfiguredAgentItem{Bindings: []dto.AgentRoleBinding{}} |
| 243 | if id, ok := record["id"].(string); ok { |
| 244 | item.ID = id |
| 245 | } else if id, ok := record["agentId"].(string); ok { |
| 246 | item.ID = id |
| 247 | } |
| 248 | if name, ok := record["name"].(string); ok { |
| 249 | item.Name = name |
| 250 | } |
| 251 | if workspace, ok := record["workspace"].(string); ok { |
| 252 | item.Workspace = resolveRoleDir(installDir, workspace) |
| 253 | } |
| 254 | if model, ok := record["model"].(string); ok { |
| 255 | item.Model = model |
| 256 | } |
| 257 | if agentDir, ok := record["agentDir"].(string); ok { |
| 258 | item.AgentDir = agentDir |
| 259 | } else if agentDir, ok := record["agent_dir"].(string); ok { |
| 260 | item.AgentDir = agentDir |
| 261 | } |
| 262 | item.AgentDir = resolveRoleDir(installDir, item.AgentDir) |
| 263 | return item |
| 264 | } |
| 265 | |
| 266 | func findConfiguredAgentByID(baseDir string, conf map[string]interface{}, id string) (dto.AgentConfiguredAgentItem, bool) { |
| 267 | agents, ok := conf["agents"].(map[string]interface{}) |
no test coverage detected