feat: show RootlessKit version in nerdctl version output#4971
Open
amarkdotdev wants to merge 1 commit into
Open
feat: show RootlessKit version in nerdctl version output#4971amarkdotdev wants to merge 1 commit into
amarkdotdev wants to merge 1 commit into
Conversation
When running in rootless mode, nerdctl version now includes the RootlessKit version as a server component, matching the format used by docker version. This helps users quickly verify which RootlessKit version is in use without running rootlesskit --version separately. The version is only shown when rootless mode is active (i.e. when rootlessutil.IsRootless() is true). If rootlesskit is not found on PATH or its output cannot be parsed, a warning is logged and the component is shown without a version string. Fixes containerd#4936 Signed-off-by: Aaron <aaroniofjm@gmail.com>
98761a9 to
02bf394
Compare
AkihiroSuda
reviewed
Jun 18, 2026
| return &dockercompat.ComponentVersion{ | ||
| Name: "rootlesskit", | ||
| Version: fields[2], | ||
| }, nil |
AkihiroSuda
reviewed
Jun 18, 2026
| // getMobySysInfo returns the moby system info for the given cgroup manager | ||
|
|
||
| func rootlessKitVersion() dockercompat.ComponentVersion { | ||
| stdout, err := exec.Command("rootlesskit", "--version").Output() |
Member
|
There was already a PR #4937 from @MD-Mushfiqur123 , but it seems accidentally closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When running in rootless mode,
nerdctl versionnow includes the RootlessKit version as a server component, matching howdocker versiondisplays it.Before:
After (rootless mode):
The
rootlesskitcomponent is only shown whenrootlessutil.IsRootless()is true. Ifrootlesskitis not found on PATH or its output cannot be parsed, a warning is logged and the component appears without a version string (same pattern asruncandbuildctl).Changes
pkg/infoutil/infoutil.go: addedrootlessKitVersion()andparseRootlessKitVersion()functions, appended toServerVersion.Componentswhen rootlesspkg/infoutil/infoutil_test.go: addedTestParseRootlessKitVersioncovering normal output, dev versions, and invalid inputTesting
go build ./pkg/infoutil/...passesgo vet ./pkg/infoutil/...passesgo test ./pkg/infoutil/...passes (including the new parse test)Fixes #4936