rancher / rio

Application Deployment Engine for Kubernetes
https://rio.io
Apache License 2.0
2.27k stars 228 forks source link

Delete webhook from Github when deleting service from Rio #970

Open oskapt opened 4 years ago

oskapt commented 4 years ago

If I delete a service, the webhook remains. If I create it again, a second webhook is added. Can the original webhook be deleted when the service is deleted?

This runs into an issue if we're deleting the webhook secret after using it (feature request), since we lose the ability to communicate with the API. Perhaps record that a webhook was created and advise that it needs to be manually deleted, or ask for the secret again to check the repo and delete the webhook automatically?

cbron commented 4 years ago

This is related to re-using webhooks: https://github.com/rancher/rio/issues/676 When multiple services start re-using a single webhook, deleting it will be more complicated. But we should be able to check if any exist and if not then delete it. Will need to add all this to gitwatcher library.
Also if we are re-using webhooks I doubt we would want to delete webhook secret.