summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShelley-BaoYue <baoyue2@huawei.com>2023-03-06 15:00:14 +0800
committerShelley-BaoYue <baoyue2@huawei.com>2023-07-26 18:49:39 +0800
commit35d709fbf44578d75babafe98dce66adbc8a103c (patch)
tree6534302b4ed2c794b631db14520a34e00fd643d2
parentMerge pull request #4874 from Shelley-BaoYue/automated-cherry-pick-of-#4814-u... (diff)
downloadkubeedge-35d709fbf44578d75babafe98dce66adbc8a103c.tar.gz
replace nodeIP initialization in edged
Signed-off-by: Shelley-BaoYue <baoyue2@huawei.com>
-rw-r--r--edge/cmd/edgecore/app/server.go16
-rw-r--r--pkg/apis/componentconfig/edgecore/v1alpha2/default.go2
2 files changed, 0 insertions, 18 deletions
diff --git a/edge/cmd/edgecore/app/server.go b/edge/cmd/edgecore/app/server.go
index 368356e95..0438829f1 100644
--- a/edge/cmd/edgecore/app/server.go
+++ b/edge/cmd/edgecore/app/server.go
@@ -3,7 +3,6 @@ package app
import (
"errors"
"fmt"
- "net"
"os"
ps "github.com/shirou/gopsutil/v3/process"
@@ -125,21 +124,6 @@ offering HTTP client capabilities to components of cloud to reach HTTP servers r
}
config.Modules.Edged.NodeIP = ip.String()
klog.Infof("Get IP address by custom interface successfully, %s: %s", config.Modules.Edged.CustomInterfaceName, config.Modules.Edged.NodeIP)
- } else {
- if net.ParseIP(config.Modules.Edged.NodeIP) != nil {
- klog.Infof("Use node IP address from config: %s", config.Modules.Edged.NodeIP)
- } else if config.Modules.Edged.NodeIP != "" {
- klog.Errorf("invalid node IP address specified: %s", config.Modules.Edged.NodeIP)
- os.Exit(1)
- } else {
- nodeIP, err := util.GetLocalIP(util.GetHostname())
- if err != nil {
- klog.Errorf("Failed to get Local IP address: %v", err)
- os.Exit(1)
- }
- config.Modules.Edged.NodeIP = nodeIP
- klog.Infof("Get node local IP address successfully: %s", nodeIP)
- }
}
registerModules(config)
diff --git a/pkg/apis/componentconfig/edgecore/v1alpha2/default.go b/pkg/apis/componentconfig/edgecore/v1alpha2/default.go
index 78e12ece0..97a761157 100644
--- a/pkg/apis/componentconfig/edgecore/v1alpha2/default.go
+++ b/pkg/apis/componentconfig/edgecore/v1alpha2/default.go
@@ -53,7 +53,6 @@ func NewDefaultEdgeCoreConfig() *EdgeCoreConfig {
TailoredKubeletConfig: &defaultTailedKubeletConfig,
TailoredKubeletFlag: TailoredKubeletFlag{
HostnameOverride: hostnameOverride,
- NodeIP: localIP,
ContainerRuntimeOptions: ContainerRuntimeOptions{
ContainerRuntime: constants.DefaultRuntimeType,
PodSandboxImage: constants.DefaultPodSandboxImage,
@@ -183,7 +182,6 @@ func NewMinEdgeCoreConfig() *EdgeCoreConfig {
TailoredKubeletConfig: &defaultTailedKubeletConfig,
TailoredKubeletFlag: TailoredKubeletFlag{
HostnameOverride: hostnameOverride,
- NodeIP: localIP,
ContainerRuntimeOptions: ContainerRuntimeOptions{
ContainerRuntime: constants.DefaultRuntimeType,
PodSandboxImage: constants.DefaultPodSandboxImage,