Protected containers: Adjust error message in docker client
What does this MR do and why?
While testing the new feature "Protected containers", we noticed that the error message shown by the docker client contains unknown: xxx
in the beginng, see screenshot section. The reason was the returned error code "PROTECTED"
was not valid.
Here is a list of all the accepted error codes that should be returned by the docker registry. In this MR, we are adjusting the error code to return "DENIED"
. With this adjusted error code, the error message of the docker client shows denied: xxx
which is more descriptive.
Similar issue was also pointed out here: !139413 (comment 1834211021)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
MR Checklist (@gerardo-navarro)
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides
Screenshots or screen recordings
The following table shows the old and new (improved) error message of the docker client when a container image is pushed to a protected container registry path.
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
Please follow the steps described here. Please observe the error message returned by the docker push
command.
Related to #427546