Skip to content

Commit

Permalink
Fix rootless node password (#7900)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola authored Jul 7, 2023
1 parent e2c35c1 commit c850132
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"
Expand Down Expand Up @@ -489,7 +490,7 @@ func verifyLocalPassword(ctx context.Context, config *Config, mu *sync.Mutex, de
// use same password file location that the agent creates
nodePasswordRoot := "/"
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")
nodePasswordFile := filepath.Join(nodeConfigPath, "password")
Expand Down

0 comments on commit c850132

Please sign in to comment.