Create secrets on Kubernetes to access GitLab Container Registry only if the project is not public
Description
In the current implementation, Auto DevOps creates secrets on Kubernetes to allow access to GitLab Container Registry. It is needed to fetch application images for deployment.
This is not necessary if the project visibility is set to public, since the images are accessible with no authentication. Also, allowing public access allows also to restart the deployment pods even if the CI_JOB_TOKEN
is expired, making deployments more usable.
Proposal
Now that we have https://gitlab.com/gitlab-org/gitlab-ce/issues/37473, we can create the secrets only if project visibility is not public.