当 githubConfigSecret 不存在时,永久删除 AutoscalingRunnerSet 条目
Checks
- I've already read https://docs.GitHub.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/troubleshooting-actions-runner-controller-errors and I'm sure my issue is not covered in the troubleshooting guide.
- I am using charts that are officially provided
Controller Version
0.14.2 (gha-runner-scale-set-controller); same code on master at 03328aa14f6435462f6a2add1f5ba79247da6e09
Deployment Method
Helm
Checks
- This isn't a question or user support case (For Q&A and community support, go to Discussions).
- I've read the Changelog before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes
To Reproduce
- Install a
gha-runner-scale-setrelease withminRunners: 0and wait until theAutoscalingRunnerSet(ARS) carries therunner-scale-set-idannotation, i.e. the scale set is registered with the Actions service. - Remove the configured secret:
kubectl delete secret <githubConfigSecret> -n <ns>(drop itsautoscalingrunnerset.actions.GitHub.com/cleanup-protectionfinalizer first if the chart created it). kubectl delete autoscalingrunnerset <name> -n <ns>(orhelm uninstall, or delete the namespace).- The ARS stays in
Terminatingindefinitely. The controller logs, on every requeue:
ERROR AutoscalingRunnerSet Failed to initialize Actions service client for updating a existing runner scale set {"error": "failed to resolve app config: failed to get Kubernetes secret: \"<ns>/<githubConfigSecret>\""}
ERROR AutoscalingRunnerSet Failed to delete runner scale set
ERROR AutoscalingRunnerSet Failed to clean up resources during deletionThe finalizer autoscalingrunnerset.actions.GitHub.com/finalizer is never removed, so kubectl delete / helm uninstall hang and a namespace containing the ARS can never finish terminating. Only manual intervention (kubectl patch ... --type=merge -p '{"metadata":{"finalizers":null}}') or recreating a secret with the old name unblocks it.
The same happens whenever the secret is gone for good rather than temporarily: the namespace is being torn down and the secret went first, the secret was rotated to a new name and the old one deleted before the ARS, or Helm removed the secret before the ARS during uninstall.
Describe the bug
During deletion, Reconcile calls cleanUpResources, which ends with deleteRunnerScaleSet:
deleteRunnerScaleSetbuilds an Actions client fromgithubConfigSecretviaGetActionsServiceand returns the error if that fails: https://GitHub.com/actions/actions-runner-controller/blob/03328aa14f6435462f6a2add1f5ba79247da6e09/controllers/actions.GitHub.com/autoscalingrunnerset_controller.go#L768-L772cleanUpResources…
内容来源: actions/actions-runner-controller