Merge pull request #7954 from klihub/devel/sbserver-nri-integration
pkg/cri/sbserver: experimental NRI integration for CRI.
This commit is contained in:
@@ -461,21 +461,19 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
sandboxCreateNetworkTimer.UpdateSince(netStart)
|
||||
}
|
||||
|
||||
if c.nri.isEnabled() {
|
||||
err = c.nri.runPodSandbox(ctx, &sandbox)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("NRI RunPodSandbox failed: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if retErr != nil {
|
||||
deferCtx, deferCancel := util.DeferContext()
|
||||
defer deferCancel()
|
||||
c.nri.removePodSandbox(deferCtx, &sandbox)
|
||||
}
|
||||
}()
|
||||
err = c.nri.RunPodSandbox(ctx, &sandbox)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("NRI RunPodSandbox failed: %w", err)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if retErr != nil {
|
||||
deferCtx, deferCancel := util.DeferContext()
|
||||
defer deferCancel()
|
||||
c.nri.RemovePodSandbox(deferCtx, &sandbox)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := task.Start(ctx); err != nil {
|
||||
return nil, fmt.Errorf("failed to start sandbox container task %q: %w", id, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user