Update error prefix of v4 container stats endpoint for task lookup failure case #3794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There is a discrepancy in the prefix of error message returned by v4 container stats endpoint between task lookup failure and container lookup failure cases.
Task lookup failure
vs
Container lookup failure
That is,
V4 container handler
vsV4 container stats handler
. We consider the former a bug and this PR makes the prefix for the two cases consistent by converging toV4 container stats handler
. This discrepancy does not exist in V3 container stats endpoint and it usesV3 container stats handler
prefix for both cases.Note that there are some unrelated changes in this PR which are a result of running
go mod vendor
for agent module. The vendor directory for agent module is out of sync.Implementation details
GetContainerStats
andGetTaskStats
methods in agent module.Testing
Built Agent from source, installed it on an EC2 instance, and invoked v4 container stats endpoint with a bad endpoint container ID.
Before
After
New tests cover the changes: yes
Description for the changelog
Update error prefix of v4 container stats endpoint for task lookup failure case
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.