Skip to content

Commit 8f5eba3

Browse files
AkihiroSudadmcgowan
authored andcommitted
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]> (cherry picked from commit 5365f4b) Signed-off-by: Derek McGowan <[email protected]>
1 parent 4908fef commit 8f5eba3

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
@@ -59,7 +59,6 @@ func init() {
5959
}
6060

6161
func initCRIService(ic *plugin.InitContext) (interface{}, error) {
62-
ready := ic.RegisterReadiness()
6362
ic.Meta.Platforms = []imagespec.Platform{platforms.DefaultSpec()}
6463
ic.Meta.Exports = map[string]string{"CRIVersion": constants.CRIVersion, "CRIVersionAlpha": constants.CRIVersionAlpha}
6564
ctx := ic.Context
@@ -102,6 +101,8 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
102101
return nil, fmt.Errorf("failed to create CRI service: %w", err)
103102
}
104103

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

0 commit comments

Comments
 (0)