Skip to content

Commit

Permalink
Add warning log message if container is not found in internal state
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc committed May 22, 2024
1 parent 69b05a2 commit 1e27c89
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/handlers/v4/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
"github.com/aws/amazon-ecs-agent/agent/engine/dockerstate"
v2 "github.com/aws/amazon-ecs-agent/agent/handlers/v2"
"github.com/aws/amazon-ecs-agent/ecs-agent/api/ecs"
"github.com/aws/amazon-ecs-agent/ecs-agent/logger"
"github.com/aws/amazon-ecs-agent/ecs-agent/logger/field"
ni "github.com/aws/amazon-ecs-agent/ecs-agent/netlib/model/networkinterface"
tmdsresponse "github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/response"
"github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/utils"
Expand Down Expand Up @@ -135,6 +137,10 @@ func augmentContainerResponse(
// did not find container, continue on and try next container(s)
// we don't return error here to avoid disrupting all of a TMDS response
// on a single missing container.
logger.Warn("V4 container response: unable to find container in internal state",
logger.Fields{
field.RuntimeID: containerID,
})
return v4Response
}
if dockerContainer.Container.RestartPolicyEnabled() {
Expand Down

0 comments on commit 1e27c89

Please sign in to comment.