smarkets / marge-bot

A merge-bot for GitLab
BSD 3-Clause "New" or "Revised" License
693 stars 136 forks source link

Kubernetes set-up without impersonate doesn't work #332

Open klepiz opened 2 years ago

klepiz commented 2 years ago

I'm tying to set marge-bot on kubernetes cluster like this ktmpl ./deploy.yml \ --parameter APP_NAME "marge-bot" \ --parameter APP_IMAGE "smarkets/marge-bot" \ --parameter KUBE_NAMESPACE "marge-bot" \ --parameter MARGE_GITLAB_URL 'https://our-git-url' \ --parameter MARGE_AUTH_TOKEN "$(cat marge-bot.token)" \ --parameter MARGE_SSH_KEY "$(cat marge-bot-ssh-key)" \ --parameter MARGE_ADD_PART_OF "true" \ --parameter MARGE_ADD_TESTED "true" \ --parameter MARGE_CI_TIMEOUT "120min" \ --parameter MARGE_GIT_TIMEOUT "3600s" \ --parameter MARGE_BATCH "true" \ --parameter MARGE_IMPERSONATE_APPROVERS 'false' \ --parameter MARGE_ADD_REVIEWERS 'false' \ --parameter REPLICA_COUNT 1 | kubectl --namespace=marge-bot apply --force -f - and the pod is returning:

Traceback (most recent call last):
  File "/nix/store/0ljil4j1g16cr8i3f2viha9rdjhcvyb7-python3.6-marge-0.10.0/bin/.marge.app-wrapped", line 6, in <module>
    marge.app.main()
  File "/nix/store/0ljil4j1g16cr8i3f2viha9rdjhcvyb7-python3.6-marge-0.10.0/lib/python3.6/site-packages/marge/app.py", line 350, in main
    marge_bot = bot.Bot(api=api, config=config)
  File "/nix/store/0ljil4j1g16cr8i3f2viha9rdjhcvyb7-python3.6-marge-0.10.0/lib/python3.6/site-packages/marge/bot.py", line 27, in __init__
    "{0.username} is not an admin, can't impersonate!".format(user)
AssertionError: robot is not an admin, can't impersonate!```

Am I missing something or is it a bug?

klepiz commented 2 years ago

I find out that you are hardcoded the flags to use on kubernetes, is there a way to be able to custumize the flags on k8s without change deploy.yaml?