MCPcopy Create free account
hub / github.com/containerd/nerdctl / isKnownContainer

Method isKnownContainer

pkg/cmd/container/stats.go:75–82  ·  view source on GitHub ↗

isKnownContainer is from https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/command/container/stats_helpers.go#L44-L51

(cid string)

Source from the content-addressed store, hash-verified

73
74// isKnownContainer is from https://github.com/docker/cli/blob/3fb4fb83dfb5db0c0753a8316f21aea54dab32c5/cli/command/container/stats_helpers.go#L44-L51
75func (s *stats) isKnownContainer(cid string) (int, bool) {
76 for i, c := range s.cs {
77 if c.ID == cid {
78 return i, true
79 }
80 }
81 return -1, false
82}
83
84// Stats displays a live stream of container(s) resource usage statistics.
85func Stats(ctx context.Context, client *containerd.Client, containerIDs []string, options types.ContainerStatsOptions) error {

Callers 2

addMethod · 0.95
removeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected