Advisor: Allow to retry checks for a single element (#104279)

This commit is contained in:
Andres Martinez Gotor
2025-04-24 12:00:32 +02:00
committed by GitHub
parent 10df5d6f23
commit edeff68645
16 changed files with 255 additions and 13 deletions
+15
View File
@@ -74,6 +74,21 @@ func New(cfg app.Config) (app.App, error) {
}
}()
}
if req.Action == resource.AdmissionActionUpdate {
go func() {
log.Debug("Updating check", "namespace", req.Object.GetNamespace(), "name", req.Object.GetName())
requester, err := identity.GetRequester(ctx)
if err != nil {
log.Error("Error getting requester", "error", err)
return
}
ctx = identity.WithRequester(context.Background(), requester)
err = processCheckRetry(ctx, client, req.Object, check)
if err != nil {
log.Error("Error processing check retry", "error", err)
}
}()
}
}
return nil
},