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

Function FindChannel

pkg/question/selectors/channels.go:29–40  ·  view source on GitHub ↗
(octopus *octopusApiClient.Client, project *projects.Project, channelName string)

Source from the content-addressed store, hash-verified

27}
28
29func FindChannel(octopus *octopusApiClient.Client, project *projects.Project, channelName string) (*channels.Channel, error) {
30 foundChannels, err := octopus.Projects.GetChannels(project) // TODO change this to channel partial name search on server; will require go client update
31 if err != nil {
32 return nil, err
33 }
34 for _, c := range foundChannels { // server doesn't support channel search by exact name so we must emulate it
35 if strings.EqualFold(c.Name, channelName) {
36 return c, nil
37 }
38 }
39 return nil, fmt.Errorf("no channel found with name of %s", channelName)
40}

Callers 1

AskQuestionsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected