Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
56bf7d6a
Commit
56bf7d6a
authored
Nov 15, 2022
by
Brad Davidson
Committed by
Brad Davidson
Nov 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow agent to run rootless
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
6f2b21c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
agent.go
pkg/cli/agent/agent.go
+2
-2
server.go
pkg/cli/server/server.go
+1
-1
No files found.
pkg/cli/agent/agent.go
View file @
56bf7d6a
...
@@ -33,8 +33,8 @@ func Run(ctx *cli.Context) error {
...
@@ -33,8 +33,8 @@ func Run(ctx *cli.Context) error {
return
err
return
err
}
}
if
os
.
Getuid
()
!=
0
&&
runtime
.
GOOS
!=
"windows"
{
if
runtime
.
GOOS
!=
"windows"
&&
os
.
Getuid
()
!=
0
&&
!
cmds
.
AgentConfig
.
Rootless
{
return
fmt
.
Errorf
(
"agent must be r
an as root
"
)
return
fmt
.
Errorf
(
"agent must be r
un as root, or with --rootless
"
)
}
}
if
cmds
.
AgentConfig
.
TokenFile
!=
""
{
if
cmds
.
AgentConfig
.
TokenFile
!=
""
{
...
...
pkg/cli/server/server.go
View file @
56bf7d6a
...
@@ -71,7 +71,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
...
@@ -71,7 +71,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
}
}
if
!
cfg
.
DisableAgent
&&
os
.
Getuid
()
!=
0
&&
!
cfg
.
Rootless
{
if
!
cfg
.
DisableAgent
&&
os
.
Getuid
()
!=
0
&&
!
cfg
.
Rootless
{
return
fmt
.
Errorf
(
"
must run as root unless --disable-agent is specified
"
)
return
fmt
.
Errorf
(
"
server must run as root, or with --rootless and/or --disable-agent
"
)
}
}
if
cfg
.
Rootless
{
if
cfg
.
Rootless
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment