Skip to content
Snippets Groups Projects
Commit 1cc082b6 authored by kaiyou's avatar kaiyou
Browse files

Properly evacuate cgroups on startup

parent bcb50584
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,10 @@ var Run = &cobra.Command{
Use: "run",
Short: "Actually run hepto inside the container",
// Determine current IP, which should run only once inside the container
// TODO: handle errors
PreRun: func(cmd *cobra.Command, args []string) {
// Start by evacuating cgroups
selfcontain.Evacuate()
// Install ourselves as a hooking binary
self, err := os.Executable()
if err != nil {
......@@ -120,7 +123,10 @@ var Run = &cobra.Command{
}
},
RunE: func(cmd *cobra.Command, args []string) error {
c := services.NewManager(&config.Cluster, &config.Node, config.Logger)
c, err := services.NewManager(&config.Cluster, &config.Node, config.Logger)
if err != nil {
return err
}
return c.Run()
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment