MCPcopy Index your code
hub / github.com/coder/coder / findAgent

Function findAgent

cli/support.go:424–437  ·  view source on GitHub ↗
(agentName string, haystack []codersdk.WorkspaceResource)

Source from the content-addressed store, hash-verified

422}
423
424func findAgent(agentName string, haystack []codersdk.WorkspaceResource) (*codersdk.WorkspaceAgent, bool) {
425 for _, res := range haystack {
426 for _, agt := range res.Agents {
427 if agentName == "" {
428 // just return the first
429 return &agt, true
430 }
431 if agt.Name == agentName {
432 return &agt, true
433 }
434 }
435 }
436 return nil, false
437}
438
439func writeBundle(src *support.Bundle, dest *zip.Writer) error {
440 // We JSON-encode the following:

Callers 1

supportBundleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected