Skip to content

Instantly share code, notes, and snippets.

View fenxiong's full-sized avatar

Feng Xiong fenxiong

View GitHub Profile
--- 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"}
+ }
{
"ipcMode": null,
"executionRoleArn": null,
"containerDefinitions": [
{
"dnsSearchDomains": [],
"logConfiguration": null,
"entryPoint": [],
"portMappings": [
{
[
{
"Id": "8876a57a1add328c1ef0aacf98833e777a97cbe1c45b4c229b308ed6f5a3b394",
"Created": "2019-10-22T18:22:40.95550303Z",
"Path": "/usr/bin/cadvisor",
"Args": [
"-logtostderr"
],
"State": {
"Status": "running",
[
{
"Id": "8876a57a1add328c1ef0aacf98833e777a97cbe1c45b4c229b308ed6f5a3b394",
"Created": "2019-10-22T18:22:40.95550303Z",
"Path": "/usr/bin/cadvisor",
"Args": [
"-logtostderr"
],
"State": {
"Status": "running",
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"TestName": {
"Type" : "String"
},
"InstanceType" : {
"Type" : "String",
"Default" : "m4.xlarge"
},