Skip to content

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)

🛠 with at Siemens

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)

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
grafik grafik

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

Edited by David Fernandez

Merge request reports