diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index 294c798967..28588f5f42 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -396,19 +396,3 @@ func getConfig(info *clientaccess.Info) (*config.Control, error) { controlControl := &config.Control{} return controlControl, json.Unmarshal(data, controlControl) } - -func HostnameCheck(cfg cmds.Agent) error { - hostname, _, err := getHostnameAndIP(cfg) - if err != nil { - return err - } - for i := 0; i < 5; i++ { - _, err = sysnet.LookupHost(hostname) - if err == nil { - return nil - } - logrus.Infof("Waiting for hostname %s to be resolvable: %v", hostname, err) - time.Sleep(time.Second * 3) - } - return fmt.Errorf("Timed out waiting for hostname %s to be resolvable: %v", hostname, err) -} diff --git a/pkg/agent/run.go b/pkg/agent/run.go index d6f6c6dc29..95777c7f16 100644 --- a/pkg/agent/run.go +++ b/pkg/agent/run.go @@ -25,10 +25,6 @@ import ( func run(ctx context.Context, cfg cmds.Agent, lb *loadbalancer.LoadBalancer) error { nodeConfig := config.Get(ctx, cfg) - if err := config.HostnameCheck(cfg); err != nil { - return err - } - if !nodeConfig.NoFlannel { if err := flannel.Prepare(ctx, nodeConfig); err != nil { return err diff --git a/pkg/agent/templates/templates.go b/pkg/agent/templates/templates.go index 7853c3f11f..d25c83b774 100644 --- a/pkg/agent/templates/templates.go +++ b/pkg/agent/templates/templates.go @@ -17,7 +17,7 @@ const ContainerdConfigTemplate = ` path = "{{ .NodeConfig.Containerd.Opt }}" [plugins.cri] -stream_server_address = "{{ .NodeConfig.AgentConfig.NodeName }}" +stream_server_address = "127.0.0.1" stream_server_port = "10010" {{- if .IsRunningInUserNS }}