feat: add an unregister command #182
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo/runner#182
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm running the runner inside kubernetes and everytime the pod get's recreated i get a new runner.
Now the old runner pod get's removed but it's still registered in forgejo.
So i like to add a shutdown hook which will unregister the runner.
Add an unregister commandto feat: add an unregister commandThis is a very needed thing when running dynamically provisioned runners. I just had to spend way to much time manually de-registering over 100 runner pods from the UI which was painful because the UI doesn't provide a way to remove multiple runners at once.
Bumped the priority.
wrongly closed from merge
good catch
@viceice The issue you linked talks about HTTP APIs. Is that sufficient for your use case or do you want to execute
forgejo-runner unregisterin a Kubernetes PreStop hook?HTTP API is a prerequisite to having an unregister command. If the API is added, we can at least script a preStop with curl and an addtional configmap to provide the script, but the end goal should be an unregister command.
I can imagine there are needs for dynamically priovisioned runners outside of Kube as well.
@Routhinator wrote in #182 (comment):
The runner talks to Forgejo using GRPC. I don't think it calls the HTTP API at any time.
An endpoint to delete runners exists in the development version of Forgejo. It would be awesome if you could try it and provide feedback.
I don't think it will be easy to do with
curlbecause you'd need to know whether it's a global, organization, user, or repository runner to call the right endpoint. I don't think we can infer this information from the.runnerfile or the local configuration. So we'd need another endpoint that could provide that information.From what I could gather so far,
forgejo-runner registeronly makes sense for people with Kubernetes or a similar system that can keep the runner registration token secret. For everyone else, corresponding HTTP APIs are being developed.What are the requirements for a
forgejo-runner unregistercommand?What I have so far:
forgejo-runner unregistershould be a no-op with exit code 0 (and a terminal message?) if there's no.runnerfile.forgejo-runner unregistershould work with the credentials stored in the.runnerfile.forgejo-runner unregisterfails for some reason, it should exit with a code > 0.forgejo-runner unregistershould remove the.runnerfile.