Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CannotPullContainerError message #4172

Closed

Conversation

nineonine
Copy link

@nineonine nineonine commented May 9, 2024

Summary

This change introduces new abstraction to parse known errors and augment error message with extra useful context.

The first error that we handle now is CannotPullContainerError, spefically, the API 404 repository not found error.
The change attempts to update error message when agent is trying to pull image using execution role.

Implementation details

  • new module was added with all the encapsulated logic - error_messages.go
  • in engine.pullAndUpdateContainerReference we use new functionality to improve error when image pull failed due to API 404 (repository not found) error

Testing

  • Unit tests added in error_messages_test.go
  • another test in docker_task_engine_test.go to capture state change event with augmented message.

New tests cover the changes:
yes

Description for the changelog

Augment CannotPullContainerError message with extra context to aid in troubleshooting tasks

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@nineonine nineonine requested a review from a team as a code owner May 9, 2024 23:52
@nineonine nineonine force-pushed the CannotPullContainerError-msg-improvement branch from 36a335b to ba6babc Compare May 10, 2024 00:02
@nineonine
Copy link
Author

closing in favor of #4181

@nineonine nineonine closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant