Created
July 6, 2021 21:19
-
-
Save fenxiong/9afdeeeedab05177b6d425c5db3eb3b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/agent/dockerclient/dockerapi/docker_client.go | |
+++ b/agent/dockerclient/dockerapi/docker_client.go | |
@@ -811,6 +811,10 @@ func (dg *dockerGoClient) containerMetadata(ctx context.Context, id string) Dock | |
ctx, cancel := context.WithTimeout(ctx, dockerclient.InspectContainerTimeout) | |
defer cancel() | |
dockerContainer, err := dg.InspectContainer(ctx, id, dockerclient.InspectContainerTimeout) | |
+ if dockerContainer.State.Status == "exited" { | |
+ seelog.Info("[TESTING] inspecting an exited container [%s]. return timeout error instead", dockerContainer.Name) | |
+ err = &DockerTimeoutError{30 * time.Second, "inspecting"} | |
+ } | |
if err != nil { | |
return DockerContainerMetadata{DockerID: id, Error: CannotInspectContainerError{err}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment