use version.Program

Signed-off-by: Brian Downs <brian.downs@gmail.com>
This commit is contained in:
Brian Downs 2020-09-03 08:51:17 -07:00
parent 301fb73952
commit 00831f9bc8
2 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ func getNodeNamedCrt(nodeName, nodeIP, nodePasswordFile string) HTTPRequester {
return nil, err return nil, err
} }
req.Header.Set(version.Program+"-Node-Password", nodePassword) 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) resp, err := client.Do(req)
if err != nil { if err != nil {

View File

@ -142,7 +142,7 @@ func servingKubeletCert(server *config.Control, keyFile string) http.Handler {
} }
ips := []net.IP{net.ParseIP("127.0.0.1")} 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)) ips = append(ips, net.ParseIP(nodeIP))
} }