Currently I cannot stop my review apps from the CI pipeline job. It’s a GitLab managed Kubernetes cluster in Google Cloud. I don’t know what changed, but I have worked on the pipeline so it’s maybe my fault. But actually I haven’t changed anything respective the stop process. The job is easy because it has only deleted the whole namespace so far.
review_stop: stage: tested variables: GIT_STRATEGY: none script: - kubectl delete namespace $KUBE_NAMESPACE environment: name: review/$CI_COMMIT_REF_NAME action: stop only: [branches] except: [master] when: manual
Now I get only this error:
$ kubectl delete namespace $KUBE_NAMESPACE
Error from server (Forbidden): namespaces "st8ment-tv-20103579-review-review-rcmeyv" is forbidden: User "system:serviceaccount:st8ment-tv-20103579-review-review-rcmeyv:st8ment-tv-20103579-review-review-rcmeyv-service-account" cannot delete resource "namespaces" in API group "" in the namespace "st8ment-tv-20103579-review-review-rcmeyv"
ERROR: Job failed: exit code 1
The branch name “review” is a special review app in my case, so I had a “Protected Branch” configuration for this. I thought it has maybe todo with each other and have already removed the configuration - without success.