Skip to content

Commit

Permalink
Fix getting host address on OpenSSH connections (#597)
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke authored Nov 15, 2023
1 parent 2242f4a commit 39674d5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,9 @@ func (h *Host) UnmarshalYAML(unmarshal func(interface{}) error) error {

// Address returns an address for the host
func (h *Host) Address() string {
if h.SSH != nil {
return h.SSH.Address
if addr := h.Connection.Address(); addr != "" {
return addr
}

if h.WinRM != nil {
return h.WinRM.Address
}

return "127.0.0.1"
}

Expand Down

0 comments on commit 39674d5

Please sign in to comment.