containerd: Do not fail on plugin failure

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2017-06-20 10:25:09 -07:00
parent b7f37e778c
commit f8d3cfbc60
No known key found for this signature in database
GPG Key ID: 40CF16616B361216
2 changed files with 5 additions and 4 deletions

View File

@ -94,21 +94,21 @@ func main() {
if config.Debug.Address != "" {
l, err := sys.GetLocalListener(config.Debug.Address, config.Debug.Uid, config.Debug.Gid)
if err != nil {
return err
return errors.Wrapf(err, "failed to get listener for debug endpoint")
}
serve(log.WithModule(ctx, "debug"), l, server.ServeDebug)
}
if config.Metrics.Address != "" {
l, err := net.Listen("tcp", config.Metrics.Address)
if err != nil {
return err
return errors.Wrapf(err, "failed to get listener for metrics endpoint")
}
serve(log.WithModule(ctx, "metrics"), l, server.ServeMetrics)
}
l, err := sys.GetLocalListener(address, config.GRPC.Uid, config.GRPC.Gid)
if err != nil {
return err
return errors.Wrapf(err, "failed to get listener for main endpoint")
}
serve(log.WithModule(ctx, "grpc"), l, server.ServeGRPC)

View File

@ -83,7 +83,8 @@ func New(ctx context.Context, config *Config) (*Server, error) {
}
instance, err := p.Init(initContext)
if err != nil {
return nil, err
log.G(ctx).WithError(err).Warnf("failed to load plugin %s", id)
continue
}
initialized[p.Type] = append(initialized[p.Type], instance)
// check for grpc services that should be registered with the server