localkube add ROOT permission check.

pull/2486/head
sheng zhang 2018-01-30 14:48:18 +08:00
parent 35d685aec6
commit 8b5ffff2d9
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@ func StartLocalkube() {
os.Exit(0)
}
// TODO: Require root
if os.Geteuid() != 0 {
fmt.Println("localkube should run as root!")
os.Exit(1)
}
SetupServer(Server)
Server.StartAll()