Skip to content

Deprecate shim.Command#13319

Merged
mxpv merged 1 commit into
containerd:mainfrom
mxpv:depr
Apr 29, 2026
Merged

Deprecate shim.Command#13319
mxpv merged 1 commit into
containerd:mainfrom
mxpv:depr

Conversation

@mxpv

@mxpv mxpv commented Apr 29, 2026

Copy link
Copy Markdown
Member

Deprecate Command from pkg/shim. This function is used by containerd to launch shims and should not be exposed to external users. This PR updates the comment so Go can recognize it as deprecated. I think it worth doing this in 2.3

Copilot AI review requested due to automatic review settings April 29, 2026 17:46
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Apr 29, 2026
@mxpv mxpv added this to the 2.3 milestone Apr 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Deprecates the exported pkg/shim.Command API via GoDoc deprecation text to discourage external consumption of daemon-only shim launch internals.

Changes:

  • Updates shim.Command doc comment punctuation/wording.
  • Adds a Deprecated: paragraph explaining intended scope (containerd daemon internals) and future relocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/shim/util.go Outdated
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Copilot AI review requested due to automatic review settings April 29, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the pkg/shim.Command Go doc comment to be recognized as deprecated, clarifying that it’s intended for internal containerd daemon shim lifecycle launches rather than external consumption.

Changes:

  • Mark pkg/shim.Command as deprecated using the Go doc Deprecated: convention and expand rationale in the comment.
  • Add staticcheck suppression at internal call sites (runtime v2 shim start/delete) to avoid SA1019 warnings while retaining required internal usage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/shim/util.go Adds a Go-recognized Deprecated: doc paragraph and clarifies intended/internal usage and future relocation.
core/runtime/v2/binary.go Suppresses staticcheck SA1019 at internal client.Command call sites with context explaining why internal usage remains valid.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/shim/util.go
// by the containerd daemon for the initial shim launches (e.g. shim -start) and makes
// no sense for shim implementations.
// Deprecated: this function is internal to the containerd daemon, which uses it to
// invoke the shim binary for "start" and "delete" actions during the shim lifecycle.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the shim is tied to the sandbox, we are supposed to run shim delete when the sandbox is terminating. However, if the shim is killed unexpectedly, how should we clean up the sidecar container?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shim delete is only used to cleanup that sandbox one. it doesn't include that sidecar containers.
It relies on shim is alive to do the cleanup. I think that original design for deletion is to make sure that resources can be cleanup. But right now, it's hard to guarantee.

@mxpv mxpv Apr 29, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I don't fully understand the question. I'm not proposing to delete this function. I'm proposing to remove it from public package and move it to containerd core because it's daemon-internal. pkg/shim meant to be used by external shim authors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I misunderstand that comment. I will post issue about shim-delete one.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Apr 29, 2026
@mxpv mxpv added this pull request to the merge queue Apr 29, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 29, 2026
@mxpv mxpv added this pull request to the merge queue Apr 29, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 29, 2026
@samuelkarp samuelkarp added this pull request to the merge queue Apr 29, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Apr 29, 2026
@mxpv mxpv added this pull request to the merge queue Apr 29, 2026
Merged via the queue into containerd:main with commit ce2955c Apr 29, 2026
97 of 100 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants