summaryrefslogtreecommitdiff
path: root/edge/cmd/edgecore
diff options
context:
space:
mode:
authorblackdobb <64015779+blackdobb@users.noreply.github.com>2021-08-20 16:19:38 +0800
committerGitHub <noreply@github.com>2021-08-20 16:19:38 +0800
commitd2cbad777ae00a444e193a18a3cbbc00a7317d33 (patch)
treea121076db1e8fb518e4c80ffd3b5b90374358284 /edge/cmd/edgecore
parentsync the response message unconditionally (#3014) (diff)
downloadkubeedge-d2cbad777ae00a444e193a18a3cbbc00a7317d33.tar.gz
add the validation of hostname due to the problem caused by long name (#3044)
Signed-off-by: blackdobb <xinxin.wan@daocloud.io>
Diffstat (limited to 'edge/cmd/edgecore')
-rw-r--r--edge/cmd/edgecore/app/server.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/edge/cmd/edgecore/app/server.go b/edge/cmd/edgecore/app/server.go
index 844a2c168..1dbcf8ea9 100644
--- a/edge/cmd/edgecore/app/server.go
+++ b/edge/cmd/edgecore/app/server.go
@@ -13,7 +13,6 @@ import (
"k8s.io/klog/v2"
"github.com/kubeedge/beehive/pkg/core"
- "github.com/kubeedge/kubeedge/common/constants"
"github.com/kubeedge/kubeedge/edge/cmd/edgecore/app/options"
"github.com/kubeedge/kubeedge/edge/pkg/common/dbm"
"github.com/kubeedge/kubeedge/edge/pkg/devicetwin"
@@ -85,10 +84,7 @@ offering HTTP client capabilities to components of cloud to reach HTTP servers r
// get edge node local ip
if config.Modules.Edged.NodeIP == "" {
- hostnameOverride, err := os.Hostname()
- if err != nil {
- hostnameOverride = constants.DefaultHostnameOverride
- }
+ hostnameOverride := util.GetHostname()
localIP, _ := util.GetLocalIP(hostnameOverride)
config.Modules.Edged.NodeIP = localIP
}