Skip to content

Commit

Permalink
added additional support for legacy hostname configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Jason011125 <[email protected]>
  • Loading branch information
Jason011125 committed Aug 18, 2023
1 parent 1ab2856 commit ab9e715
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 ab9e715

Please sign in to comment.