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

Function GetSshAccount

pkg/machinescommon/ssh_common.go:209–223  ·  view source on GitHub ↗
(opts *SshCommonOptions, flags *SshCommonFlags)

Source from the content-addressed store, hash-verified

207}
208
209func GetSshAccount(opts *SshCommonOptions, flags *SshCommonFlags) (accounts.IAccount, error) {
210 idOrName := flags.Account.Value
211 allAccounts, err := opts.GetAllAccountsForSshMachine()
212 if err != nil {
213 return nil, err
214 }
215
216 for _, a := range allAccounts {
217 if strings.EqualFold(a.GetID(), idOrName) || strings.EqualFold(a.GetName(), idOrName) {
218 return a, nil
219 }
220 }
221
222 return nil, fmt.Errorf("cannot find account %s", idOrName)
223}

Callers 2

createRunFunction · 0.92
PromptForSshAccountFunction · 0.85

Calls 1

GetNameMethod · 0.65

Tested by

no test coverage detected