Merge pull request #555 from stevvooe/remove-cli-dependence-content-store-main
cmd/containerd: remove cli.Context dependence for content.Store
This commit is contained in:
commit
b7805198b1
1 changed files with 3 additions and 4 deletions
|
@ -90,17 +90,16 @@ func main() {
|
||||||
}
|
}
|
||||||
serveMetricsAPI()
|
serveMetricsAPI()
|
||||||
|
|
||||||
contentStore, err := resolveContentStore(context)
|
contentStore, err := resolveContentStore()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
contentService := content.NewService(contentStore)
|
|
||||||
|
|
||||||
// start the GRPC api with the execution service registered
|
// start the GRPC api with the execution service registered
|
||||||
server := newGRPCServer()
|
server := newGRPCServer()
|
||||||
|
|
||||||
api.RegisterContainerServiceServer(server, execution.New(supervisor))
|
api.RegisterContainerServiceServer(server, execution.New(supervisor))
|
||||||
contentapi.RegisterContentServer(server, contentService)
|
contentapi.RegisterContentServer(server, content.NewService(contentStore))
|
||||||
|
|
||||||
// start the GRPC api with registered services
|
// start the GRPC api with registered services
|
||||||
if err := serveGRPC(server); err != nil {
|
if err := serveGRPC(server); err != nil {
|
||||||
|
@ -204,7 +203,7 @@ func serveDebugAPI() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func resolveContentStore(context *cli.Context) (*content.Store, error) {
|
func resolveContentStore() (*content.Store, error) {
|
||||||
cp := filepath.Join(conf.Root, "content")
|
cp := filepath.Join(conf.Root, "content")
|
||||||
return content.NewStore(cp)
|
return content.NewStore(cp)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue