MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / FindWorkerPoolIds

Function FindWorkerPoolIds

pkg/cmd/worker/shared/workerpool.go:56–77  ·  view source on GitHub ↗
(opts *WorkerPoolOptions, flags *WorkerPoolFlags)

Source from the content-addressed store, hash-verified

54}
55
56func FindWorkerPoolIds(opts *WorkerPoolOptions, flags *WorkerPoolFlags) ([]string, error) {
57 var ids []string
58
59 lookup := make(map[string]string)
60 for _, i := range flags.WorkerPools.Value {
61 lookup[i] = i
62 }
63
64 allWorkerPools, err := opts.GetAllWorkerPoolsCallback()
65 if err != nil {
66 return nil, err
67 }
68 for _, p := range allWorkerPools {
69 if _, ok := lookup[p.ID]; ok {
70 ids = append(ids, p.ID)
71 } else if _, ok := lookup[p.Name]; ok {
72 ids = append(ids, p.ID)
73 }
74 }
75
76 return ids, nil
77}
78
79func PromptForWorkerPools(opts *WorkerPoolOptions, flags *WorkerPoolFlags) error {
80 if util.Empty(flags.WorkerPools.Value) {

Callers 2

createRunFunction · 0.92
createRunFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected