FindNodeByNameInGroup searches for a node with the given name across all profiles. Returns the node and its source profile name, or an error if not found.
(ctx context.Context, nodeName string)
| 439 | // FindNodeByNameInGroup searches for a node with the given name across all profiles. |
| 440 | // Returns the node and its source profile name, or an error if not found. |
| 441 | func (m *GroupClientManager) FindNodeByNameInGroup(ctx context.Context, nodeName string) (*Node, string, error) { |
| 442 | nodes, err := m.GetGroupNodes(ctx) |
| 443 | if err != nil { |
| 444 | return nil, "", err |
| 445 | } |
| 446 | |
| 447 | for _, node := range nodes { |
| 448 | if node.Name == nodeName { |
| 449 | return node, node.SourceProfile, nil |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | return nil, "", fmt.Errorf("node with name %s not found in any profile", nodeName) |
| 454 | } |
| 455 | |
| 456 | // GetGroupTasks retrieves tasks from all connected profiles in the group. |
| 457 | // Each task's SourceProfile field is set to identify which profile it came from. |
no test coverage detected