Skip to content

Commit

Permalink
added additional support for legacy hostname configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason011125 committed Aug 18, 2023
1 parent b8e3fb6 commit c7d8f4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/configure/hosts/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ func (hc *HostConfig) Build() error {
hc.config[key] = nil // delete labels section
continue
}

//if we detect hostname instead of host ip, change it to host ip.
if key == "hostname" {
key = "hostip"
}
if itemset.Get(key) == nil {
return errno.ERR_UNSUPPORT_HOSTS_CONFIGURE_ITEM.
F("hosts[%d].%s = %v", hc.sequence, key, value)
Expand All @@ -139,7 +142,6 @@ func (hc *HostConfig) Build() error {
hc.config[key] = v
}
}

privateKeyFile := hc.GetPrivateKeyFile()
if len(hc.GetHost()) == 0 {
return errno.ERR_HOST_FIELD_MISSING.
Expand Down

0 comments on commit c7d8f4f

Please sign in to comment.