diff --git a/pkg/agent/config/config.go b/pkg/agent/config/config.go index 3925820916..2310f2f6d2 100644 --- a/pkg/agent/config/config.go +++ b/pkg/agent/config/config.go @@ -80,7 +80,7 @@ func getNodeNamedCrt(nodeName, nodeIP, nodePasswordFile string) HTTPRequester { return nil, err } req.Header.Set(version.Program+"-Node-Password", nodePassword) - req.Header.Set("X-K3S-NODE-IP", nodeIP) + req.Header.Set("X-"+version.Program+"-NODE-IP", nodeIP) resp, err := client.Do(req) if err != nil { diff --git a/pkg/server/router.go b/pkg/server/router.go index c09df22c61..90e62b7055 100644 --- a/pkg/server/router.go +++ b/pkg/server/router.go @@ -142,7 +142,7 @@ func servingKubeletCert(server *config.Control, keyFile string) http.Handler { } ips := []net.IP{net.ParseIP("127.0.0.1")} - if nodeIP := req.Header.Get("X-K3S-NODE-IP"); nodeIP != "" { + if nodeIP := req.Header.Get("X-" + version.Program + "-NODE-IP"); nodeIP != "" { ips = append(ips, net.ParseIP(nodeIP)) }