@kfox1111 I think there is a "chicken and egg" issue to work out here. This block seems to fail if the secret doesn't already exist:
Current Code
|
SECRET_NAME="${SECRET_NAME:-gitlab-registry-token}" |
|
kubectl get secret "$SECRET_NAME" || kubectl create secret docker-registry "$SECRET_NAME" --docker-server="$CI_REGISTRY" --docker-username="$CI_DEPLOY_USER" --docker-password="$CI_DEPLOY_PASSWORD" --docker-email=gitab@blackhole.com |
Current Output
$ SECRET_NAME="${SECRET_NAME:-gitlab-registry-token}" # collapsed multi-line command
Error from server (NotFound): secrets "config-editor-deploy-token" not found
error: flag docker-username is required
See 'kubectl create secret docker-registry -h' for help and examples
Proposed Solution
I would propose something more like:
script:
- |
SECRET_NAME="${SECRET_NAME:-gitlab-registry-token}"
kubectl create secret docker-registry "$SECRET_NAME" --docker-server="$CI_REGISTRY" --docker-username="$CI_DEPLOY_USER" --docker-password="$CI_DEPLOY_PASSWORD" --docker-email=gitab@blackhole.com --dry-run -o yaml | kubectl apply -f -
@kfox1111 I think there is a "chicken and egg" issue to work out here. This block seems to fail if the secret doesn't already exist:
Current Code
gitlab-lib/gitlab-lib.yaml
Lines 123 to 124 in 9db5170
Current Output
Proposed Solution
I would propose something more like: