Unverified Commit 70f82496 authored by Derek Nola's avatar Derek Nola Committed by GitHub

Fix rootless node password (#7899)

parent 062fdf23
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"net" "net"
"net/http" "net/http"
"os" "os"
"path"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
...@@ -489,7 +490,7 @@ func verifyLocalPassword(ctx context.Context, config *Config, mu *sync.Mutex, de ...@@ -489,7 +490,7 @@ func verifyLocalPassword(ctx context.Context, config *Config, mu *sync.Mutex, de
// use same password file location that the agent creates // use same password file location that the agent creates
nodePasswordRoot := "/" nodePasswordRoot := "/"
if config.ControlConfig.Rootless { if config.ControlConfig.Rootless {
nodePasswordRoot = filepath.Join(config.ControlConfig.DataDir, "agent") nodePasswordRoot = filepath.Join(path.Dir(config.ControlConfig.DataDir), "agent")
} }
nodeConfigPath := filepath.Join(nodePasswordRoot, "etc", "rancher", "node") nodeConfigPath := filepath.Join(nodePasswordRoot, "etc", "rancher", "node")
nodePasswordFile := filepath.Join(nodeConfigPath, "password") nodePasswordFile := filepath.Join(nodeConfigPath, "password")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment