MCPcopy
hub / github.com/google/cadvisor / sanityCheckContainerd

Function sanityCheckContainerd

integration/tests/api/containerd_test.go:72–75  ·  view source on GitHub ↗

Sanity check the container by: - Checking that the specified ID is a valid alias for this container. - Verifying that stats are not empty.

(containerID string, containerInfo info.ContainerInfo, t *testing.T)

Source from the content-addressed store, hash-verified

70// - Checking that the specified ID is a valid alias for this container.
71// - Verifying that stats are not empty.
72func sanityCheckContainerd(containerID string, containerInfo info.ContainerInfo, t *testing.T) {
73 assert.Contains(t, containerInfo.Aliases, containerID, "Alias %q should be in list of aliases %v", containerID, containerInfo.Aliases)
74 assert.NotEmpty(t, containerInfo.Stats, "Expected container to have stats")
75}
76
77// findContainerdContainer finds a container by ID in the list of containers.
78func findContainerdContainer(containerID string, containers []info.ContainerInfo) *info.ContainerInfo {

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…