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
+7
View File
@@ -14,6 +14,7 @@ import (
const (
TypeLabel = "advisor.grafana.app/type"
StatusAnnotation = "advisor.grafana.app/status"
RetryAnnotation = "advisor.grafana.app/retry"
StatusAnnotationError = "error"
StatusAnnotationProcessed = "processed"
)
@@ -22,12 +23,14 @@ func NewCheckReportFailure(
severity advisor.CheckReportFailureSeverity,
stepID string,
item string,
itemID string,
links []advisor.CheckErrorLink,
) *advisor.CheckReportFailure {
return &advisor.CheckReportFailure{
Severity: severity,
StepID: stepID,
Item: item,
ItemID: itemID,
Links: links,
}
}
@@ -47,6 +50,10 @@ func GetStatusAnnotation(obj resource.Object) string {
return obj.GetAnnotations()[StatusAnnotation]
}
func GetRetryAnnotation(obj resource.Object) string {
return obj.GetAnnotations()[RetryAnnotation]
}
func SetStatusAnnotation(ctx context.Context, client resource.Client, obj resource.Object, status string) error {
annotations := obj.GetAnnotations()
if annotations == nil {