Skip to content

Commit c7d8f4f

Browse files
committed
added additional support for legacy hostname configuration
1 parent b8e3fb6 commit c7d8f4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/configure/hosts/hosts.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ func (hc *HostConfig) Build() error {
126126
hc.config[key] = nil // delete labels section
127127
continue
128128
}
129-
129+
//if we detect hostname instead of host ip, change it to host ip.
130+
if key == "hostname" {
131+
key = "hostip"
132+
}
130133
if itemset.Get(key) == nil {
131134
return errno.ERR_UNSUPPORT_HOSTS_CONFIGURE_ITEM.
132135
F("hosts[%d].%s = %v", hc.sequence, key, value)
@@ -139,7 +142,6 @@ func (hc *HostConfig) Build() error {
139142
hc.config[key] = v
140143
}
141144
}
142-
143145
privateKeyFile := hc.GetPrivateKeyFile()
144146
if len(hc.GetHost()) == 0 {
145147
return errno.ERR_HOST_FIELD_MISSING.

0 commit comments

Comments
 (0)