Provisioning finalisers fix 2 (#111679)
* adding some logs to better understand what might be happening * only focus this PR on improve logging in finalizer handling * debug log before calling finalizers * working on finalizers * removing last todos, adding unit tests * better use SupportedFinalizers name * addressing comments * wip: fix tests and add delete error in status * chore: codegen * chore: codegen openapi * Merge remote-tracking branch 'origin/main' into provisioning-finalisers-fix-2 * update frontend client * fix: errors in testing * fix: breaking test --------- Co-authored-by: Daniele Ferru <daniele.ferru@grafana.com> Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
@@ -273,9 +273,14 @@ func (r *githubWebhookRepository) deleteWebhook(ctx context.Context) error {
|
||||
|
||||
id := r.config.Status.Webhook.ID
|
||||
|
||||
if err := r.gh.DeleteWebhook(ctx, r.owner, r.repo, id); err != nil {
|
||||
err := r.gh.DeleteWebhook(ctx, r.owner, r.repo, id)
|
||||
if err != nil && !errors.Is(err, ErrResourceNotFound) {
|
||||
return fmt.Errorf("delete webhook: %w", err)
|
||||
}
|
||||
if errors.Is(err, ErrResourceNotFound) {
|
||||
logger.Info("webhook does not exist", "url", r.config.Status.Webhook.URL, "id", id)
|
||||
return nil
|
||||
}
|
||||
|
||||
logger.Info("webhook deleted", "url", r.config.Status.Webhook.URL, "id", id)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user