Skip to content

Commit

Permalink
feat: log ValidationResult metadata on completion
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerGillson committed Aug 29, 2023
1 parent 660a80d commit 0cc38e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/controller/validationresult_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ func (r *ValidationResultReconciler) Reconcile(ctx context.Context, req ctrl.Req
r.Log.V(0).Info("Plugin", "name", vr.Spec.Plugin)

if vr.Status.State == validationv1alpha1.ValidationFailed || vr.Status.State == validationv1alpha1.ValidationSucceeded {
r.Log.V(0).Info("Validation complete", "state", vr.Status.State)
r.Log.V(0).Info("ValidationResult complete", "name", vr.Name, "state", vr.Status.State)

for _, c := range vr.Status.Conditions {
r.Log.V(0).Info("ValidationResult metadata", "type", c.ValidationType,
"rule", c.ValidationRule, "status", c.Status,
"message", c.Message, "details", c.Details,
"failures", c.Failures, "time", c.LastValidationTime,
)
}

// TODO: send result to a sink
}
Expand Down

0 comments on commit 0cc38e5

Please sign in to comment.