-
Notifications
You must be signed in to change notification settings - Fork 1.2k
scaleset listener's config is not deleted on cleanup #4029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello! Thank you for filing an issue. The maintainers will triage your issue shortly. In the meantime, please take a look at the troubleshooting guide for bug reports. If this is a feature request, please review our contribution guidelines. |
Maybe this is happening because the listener pod gets recreated by the reconciler between the return on line 292 and the next execution? So it never matches line 293 ( |
Hmm no, it doesn't even get there. What I think happens is that the pod terminates because the container terminates and restartPolicy is set to never. Then the Reconcile loop sees that, deletes the pod, and recreates it the next loop. But because the config secret isn't deleted, it doesn't get recreated, so it still has the old values. |
Hey @hsmade, if you want to update the token, you should probably update it for the autoscaling runner set as well. But if this secret gets updated, we should probably re-create the AutoscalingListener resource which should re-create the configuration and the listener pod, mirror secret etc. |
This should fix actions#4029. When the github token gets updated, and the old one expires, the listener pod dies. Only to be recreated with the existing listener config that holds the now expired token. This PR fixes that by deleting the config secret as well, so the reconciler recreates it with the updated token.
Hi! The autoscaler runner set has: spec:
githubConfigSecret: github-auth Which is the secret that is getting updated. But the changes don't get reflected in the listener. What I suggest is that when the listener pod gets deleted, its config secret gets deleted as well. PR #4033 is what I tested on my environment, and seems to fix the issue. |
Hey @hsmade, Thank you for raising the PR, but it doesn't fix the root of the problem. The listener exit could be happening due to various reasons, and re-creating the secret on each crash would put more pressure on the API server without any need for it. Would you be interested in testing this change? |
The code does seem to know when the mirror secret is out of sync. Maybe that should invalidate the config secrets as well: mirrorSecretDataHash := mirrorSecret.Labels["secret-data-hash"]
secretDataHash := hash.ComputeTemplateHash(secret.Data)
if mirrorSecretDataHash != secretDataHash {
log.Info("Updating mirror listener secret for the listener pod", "mirrorSecretDataHash", mirrorSecretDataHash, "secretDataHash", secretDataHash)
return r.updateSecretsForListener(ctx, secret, mirrorSecret, log)
} I'm confused to as to why |
Hey @hsmade, I was playing around with the fix, and I was wondering if you can simply update the values.yaml file and re-apply the new secret with it, wouldn't that solve your problem? Instead of updating the secret directly, you update it through the values.yaml file. We do have some mechanisms to understand when the values.yaml hash is changed, and it should solve your problem. |
Checks
Controller Version
0.11.0
Deployment Method
Helm
Checks
To Reproduce
Describe the bug
actions-runner-controller/controllers/actions.github.com/autoscalinglistener_controller.go
Line 296 in 462db4d
So the lines after also never run, which seem to be in charge of deleting the config secret.
Which results into the following, when the token gets refreshed / replaced in the original secret (configured with the
autoscalingrunnerset.spec.githubConfigSecret
):Describe the expected behavior
I would expect that if I replace the token in the secret configured in
autoscalingrunnerset.spec.githubConfigSecret
, the listener pod will eventually run with the new token.Additional Context
.
Controller Logs
Runner Pod Logs
The text was updated successfully, but these errors were encountered: