Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nerdctl info on Windows #3158

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

TinaMor
Copy link
Contributor

@TinaMor TinaMor commented Jul 1, 2024

What does this PR do?

The nerdctl info command currently lacks certain information specific to the Windows OS. The necessary methods to retrieve this information are not yet implemented.

infoutil_windows.go#L29-L36C2

This PR aims to address the missing Windows OS-specific information in the nerdctl info command by implementing the required methods.

image

Bug reference:
Bug #3160 Windows system information missing in "nerdctl info"

@TinaMor TinaMor marked this pull request as draft July 1, 2024 19:35
@AkihiroSuda
Copy link
Member

What was the issue on Windows?

@TinaMor
Copy link
Contributor Author

TinaMor commented Jul 1, 2024

What was the issue on Windows?

@AkihiroSuda Filed a bug #3160

@TinaMor TinaMor closed this Jul 1, 2024
@TinaMor TinaMor reopened this Jul 1, 2024
@TinaMor TinaMor force-pushed the tinamor/dev branch 2 times, most recently from 1389735 to 4b476c4 Compare July 2, 2024 11:58
@TinaMor TinaMor marked this pull request as ready for review July 2, 2024 12:25
@AkihiroSuda AkihiroSuda requested a review from jsturtevant July 3, 2024 02:37
@AkihiroSuda AkihiroSuda added the platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2) label Jul 3, 2024
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Jul 3, 2024
pkg/cmd/system/info.go Outdated Show resolved Hide resolved
pkg/infoutil/infoutil_windows.go Outdated Show resolved Hide resolved
pkg/cmd/system/info.go Outdated Show resolved Hide resolved
@TinaMor TinaMor force-pushed the tinamor/dev branch 6 times, most recently from 50b4b1e to 8e3cb73 Compare July 8, 2024 14:59
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

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

looking good, The windows code looks fine, a couple minor nits on the printing function

@@ -153,13 +153,45 @@ func prettyPrintInfoDockerCompat(stdout io.Writer, stderr io.Writer, info *docke
// Storage Driver is not really Server concept for nerdctl, but mimics `docker info` output
fmt.Fprintf(w, " Storage Driver: %s\n", info.Driver)
fmt.Fprintf(w, " Logging Driver: %s\n", info.LoggingDriver)
fmt.Fprintf(w, " Cgroup Driver: %s\n", info.CgroupDriver)
fmt.Fprintf(w, " Cgroup Version: %s\n", info.CgroupVersion)
printF(w, " Cgroup Driver: ", info.CgroupDriver)
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra space?

there isn't anything particular wrong with this but it might be simpler to either to print blank or wrap it like info.warnings below:

if info.CgroupDriver != "" { fmt.Fprintf(w, " Cgroup Driver: %s\n",, CgroupDriver ) }

fmt.Fprintf(w, " %s: %s\n", label, dockerCompatInfo)
}

func printSecurityOptions(w io.Writer, securityOptions []string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here to match what is done with warnings i.e if (len(securityoptions) > 0) ....

@@ -175,21 +207,7 @@ func prettyPrintInfoDockerCompat(stdout io.Writer, stderr io.Writer, info *docke
if k == "name" {
continue
}
fmt.Fprintf(w, " %s: %s\n", cases.Title(language.English).String(k), v)
fmt.Fprintf(w, " %s:\t%s\n", cases.Title(language.English).String(k), v)
Copy link
Contributor

Choose a reason for hiding this comment

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

should the tab be here? I don't see it used in rest of the print statements

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 77e6f18 into containerd:main Jul 10, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants