Skip to content

Commit 5365f4b

Browse files
committed
cri: call RegisterReadiness after NewCRIService
`NewCRIService()` may easily fail and its error has to be ignored unless the CRI plugin is in the `required_plugins` list. Now this has to be called before `RegisterReadiness()`, as PR 9153 "Require plugins to succeed after registering readiness" was merged on 2023-09-29. Fix issue 9163: `[Regression in main (2023-09-29)]: containerd-rootless.sh doesn't start up` Signed-off-by: Akihiro Suda <[email protected]>
1 parent c5ce2a5 commit 5365f4b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pkg/cri/cri.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func init() {
5454
}
5555

5656
func initCRIService(ic *plugin.InitContext) (interface{}, error) {
57-
ready := ic.RegisterReadiness()
5857
ic.Meta.Platforms = []imagespec.Platform{platforms.DefaultSpec()}
5958
ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion}
6059
ctx := ic.Context
@@ -99,6 +98,8 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
9998
return nil, fmt.Errorf("failed to create CRI service: %w", err)
10099
}
101100

101+
// RegisterReadiness() must be called after NewCRIService(): https://github.com/containerd/containerd/issues/9163
102+
ready := ic.RegisterReadiness()
102103
go func() {
103104
if err := s.Run(ready); err != nil {
104105
log.G(ctx).WithError(err).Fatal("Failed to run CRI service")

0 commit comments

Comments
 (0)