resolveSSHUser determines the SSH user for a node, preferring the node's source profile when present.
(app *components.App, node *api.Node)
| 123 | |
| 124 | // resolveSSHUser determines the SSH user for a node, preferring the node's source profile when present. |
| 125 | func resolveSSHUser(app *components.App, node *api.Node) string { |
| 126 | cfg := app.Config() |
| 127 | if cfg == nil { |
| 128 | return "" |
| 129 | } |
| 130 | |
| 131 | sourceProfile := "" |
| 132 | if node != nil { |
| 133 | sourceProfile = node.SourceProfile |
| 134 | } |
| 135 | |
| 136 | return cfg.ResolveSSHSettings(sourceProfile).SSHUser |
| 137 | } |
no test coverage detected