From ab9e715af38147594e3b42f591fd2ffab4d62a23 Mon Sep 17 00:00:00 2001 From: Jason011125 Date: Fri, 18 Aug 2023 08:46:02 +0800 Subject: [PATCH] added additional support for legacy hostname configuration Signed-off-by: Jason011125 --- internal/configure/hosts/hosts.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/configure/hosts/hosts.go b/internal/configure/hosts/hosts.go index 38ac432f8..d5c45cf0b 100644 --- a/internal/configure/hosts/hosts.go +++ b/internal/configure/hosts/hosts.go @@ -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) @@ -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.