notify readiness when registered plugins are ready

Signed-off-by: Henry Wang <henwang@amazon.com>
This commit is contained in:
Henry Wang
2023-05-26 03:07:40 +00:00
parent ed7c0ebe28
commit 4bfcac85fa
6 changed files with 42 additions and 16 deletions

View File

@@ -54,6 +54,7 @@ func init() {
}
func initCRIService(ic *plugin.InitContext) (interface{}, error) {
ready := ic.RegisterReadiness()
ic.Meta.Platforms = []imagespec.Platform{platforms.DefaultSpec()}
ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion}
ctx := ic.Context
@@ -99,7 +100,7 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
}
go func() {
if err := s.Run(); err != nil {
if err := s.Run(ready); err != nil {
log.G(ctx).WithError(err).Fatal("Failed to run CRI service")
}
// TODO(random-liu): Whether and how we can stop containerd.