Skip to content

daemon: include moby module version in version response#52170

Merged
vvoland merged 4 commits intomoby:masterfrom
thaJeztah:no_mod
Apr 2, 2026
Merged

daemon: include moby module version in version response#52170
vvoland merged 4 commits intomoby:masterfrom
thaJeztah:no_mod

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Mar 12, 2026

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

Comment on lines +28 to +29
// If the module is replaced (for example via go.work or replace directives),
// or no usable version information is available, Version returns an empty string.
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.

This doesn't match the implementation. When module is replaced, the replaced version is returned, not empty string.

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.

if dep.Replace != nil && dep.Replace.Version != "" {
v = dep.Replace.Version
}

Copy link
Copy Markdown
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM (assuming the implementation is correct, we can fix the comment in a follow up)

@thaJeztah
Copy link
Copy Markdown
Member Author

Good callout on the "replace" - it's probably still "ok" in most cases, but we hard-code the module name in the version response currently; let me do a quick push to match the implementation with the comment, then (for a future update) we should change the Version function to return both the "actual" module-name and version, so that if a binary was built through a replace, we should probably include that in the version response?

Use the same implementation as is used in the client.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@vvoland vvoland merged commit c493753 into moby:master Apr 2, 2026
272 of 274 checks passed
@thaJeztah thaJeztah deleted the no_mod branch April 2, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api: include module versions in "Components" response

2 participants