Skip to content

[release/2.2] cri: reject CreateContainer when sandbox is not running#13669

Merged
samuelkarp merged 1 commit into
containerd:release/2.2from
k8s-infra-cherrypick-robot:cherry-pick-13654-to-release/2.2
Jun 26, 2026
Merged

[release/2.2] cri: reject CreateContainer when sandbox is not running#13669
samuelkarp merged 1 commit into
containerd:release/2.2from
k8s-infra-cherrypick-robot:cherry-pick-13654-to-release/2.2

Conversation

@k8s-infra-cherrypick-robot

@k8s-infra-cherrypick-robot k8s-infra-cherrypick-robot commented Jun 25, 2026

Copy link
Copy Markdown

This is an automated cherry-pick of #13654

/assign AkihiroSuda

Reject CreateContainer calls when the target sandbox is not running

Before this fix, CreateContainer would proceed even if the sandbox
had already stopped or was in an unknown state. This could result in
containers being created in an unusable sandbox, leading to confusing
errors downstream.

StartContainer already guards with the same check:

  if sandbox.Status.Get().State != sandboxstore.StateReady {
      return nil, fmt.Errorf("sandbox container %q is not running", ...)
  }

Apply the identical guard in CreateContainer, immediately after the
sandbox state is known, so that callers receive a clear error instead
of a partial container object.

Fixes containerd#13599

Signed-off-by: crawfordxx <[email protected]>
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jun 26, 2026
@samuelkarp
samuelkarp merged commit dbef224 into containerd:release/2.2 Jun 26, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jun 26, 2026
@chrishenzie chrishenzie added impact/changelog area/cri Container Runtime Interface (CRI) labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) impact/changelog size/XS

Projects

Development

Successfully merging this pull request may close these issues.

6 participants