MCPcopy Create free account
hub / github.com/docker/cli / prettyPrintServerInfo

Function prettyPrintServerInfo

cli/command/system/info.go:241–411  ·  view source on GitHub ↗

nolint:gocyclo

(streams command.Streams, info *dockerInfo)

Source from the content-addressed store, hash-verified

239
240//nolint:gocyclo
241func prettyPrintServerInfo(streams command.Streams, info *dockerInfo) {
242 output := streams.Out()
243
244 fprintln(output, " Containers:", info.Containers)
245 fprintln(output, " Running:", info.ContainersRunning)
246 fprintln(output, " Paused:", info.ContainersPaused)
247 fprintln(output, " Stopped:", info.ContainersStopped)
248 fprintln(output, " Images:", info.Images)
249 fprintlnNonEmpty(output, " Server Version:", info.ServerVersion)
250 fprintlnNonEmpty(output, " Storage Driver:", info.Driver)
251 if info.DriverStatus != nil {
252 for _, pair := range info.DriverStatus {
253 fprintf(output, " %s: %s\n", pair[0], pair[1])
254 }
255 }
256 if info.SystemStatus != nil {
257 for _, pair := range info.SystemStatus {
258 fprintf(output, " %s: %s\n", pair[0], pair[1])
259 }
260 }
261 fprintlnNonEmpty(output, " Logging Driver:", info.LoggingDriver)
262 fprintlnNonEmpty(output, " Cgroup Driver:", info.CgroupDriver)
263 fprintlnNonEmpty(output, " Cgroup Version:", info.CgroupVersion)
264
265 fprintln(output, " Plugins:")
266 fprintln(output, " Volume:", strings.Join(info.Plugins.Volume, " "))
267 fprintln(output, " Network:", strings.Join(info.Plugins.Network, " "))
268
269 if len(info.Plugins.Authorization) != 0 {
270 fprintln(output, " Authorization:", strings.Join(info.Plugins.Authorization, " "))
271 }
272
273 fprintln(output, " Log:", strings.Join(info.Plugins.Log, " "))
274
275 if len(info.CDISpecDirs) > 0 {
276 fprintln(output, " CDI spec directories:")
277 for _, dir := range info.CDISpecDirs {
278 fprintf(output, " %s\n", dir)
279 }
280 }
281
282 if len(info.DiscoveredDevices) > 0 {
283 fprintln(output, " Discovered Devices:")
284 for _, device := range info.DiscoveredDevices {
285 fprintf(output, " %s: %s\n", device.Source, device.ID)
286 }
287 }
288
289 fprintln(output, " Swarm:", info.Swarm.LocalNodeState)
290 printSwarmInfo(output, *info.Info)
291
292 if len(info.Runtimes) > 0 {
293 names := make([]string, 0, len(info.Runtimes))
294 for name := range info.Runtimes {
295 names = append(names, name)
296 }
297 fprintln(output, " Runtimes:", strings.Join(names, " "))
298 fprintln(output, " Default Runtime:", info.DefaultRuntime)

Callers 1

prettyPrintInfoFunction · 0.85

Calls 6

fprintlnFunction · 0.85
fprintlnNonEmptyFunction · 0.85
fprintfFunction · 0.85
printSwarmInfoFunction · 0.85
OutMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…