ContainerStatus to return container resources

Signed-off-by: ruiwen-zhao <ruiwen@google.com>
This commit is contained in:
ruiwen-zhao
2022-08-10 03:56:56 +00:00
parent 6e4b6830f1
commit b7b1200dd3
7 changed files with 215 additions and 14 deletions

View File

@@ -143,6 +143,9 @@ func TestContainerdImage(t *testing.T) {
if err != nil {
return false, err
}
if s.Resources == nil || (s.Resources.Linux == nil && s.Resources.Windows == nil) {
return false, fmt.Errorf("No Resource field in container status: %+v", s)
}
return s.GetState() == runtime.ContainerState_CONTAINER_RUNNING, nil
}
require.NoError(t, Eventually(checkContainer, 100*time.Millisecond, 10*time.Second))