Auto-create docker-registry secret fails if namespace does not exists
Describe the bug
Auto-create docker-registry secret fails if namespace does not exists. Everytime a new review environment is created, the first run fails, because it could not create the secret.
[INFO] --- Create registry pull secret: gitlab-registry
Error from server (NotFound): error when creating "STDIN": namespaces "foo" not found
Expected behavior
Secret is created, job doesn't fail.
Actual behavior
Job fails. Nothing is deployed.
The issue was reproduced using:
- Version of the template: 4.0.1 legacy template
- GitLab server(s): Self-hosted
Configured GitLab CI project or group variables:
-
CI_DEPLOY_USERis set -
CI_DEPLOY_PASSWORDis set