From 1ab4c85153e1074716706123b640a00083324cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilson=20J=C3=BAnior?= Date: Mon, 30 Sep 2024 17:04:54 -0300 Subject: [PATCH] Add log when validationHash changes --- controllers/validation_controller.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/controllers/validation_controller.go b/controllers/validation_controller.go index e4285af1..79d3c34f 100644 --- a/controllers/validation_controller.go +++ b/controllers/validation_controller.go @@ -127,13 +127,15 @@ func (r *RpaasValidationReconciler) Reconcile(ctx context.Context, req ctrl.Requ } func (r *RpaasValidationReconciler) finishValidation(ctx context.Context, existingPod *corev1.Pod, validation *v1alpha1.RpaasValidation, validationHash string) (finished bool, err error) { - if existingPod.Annotations[v1alpha1.RpaasOperatorValidationHashAnnotationKey] != validationHash { - return false, nil - } - logger := r.Log.WithName("finishValidation"). WithValues("RpaasValidation", types.NamespacedName{Name: validation.Name, Namespace: validation.Namespace}) + actualValidationHash := existingPod.Annotations[v1alpha1.RpaasOperatorValidationHashAnnotationKey] + if actualValidationHash != validationHash { + logger.Info("validation hash mismatch", "expected", validationHash, "actual", actualValidationHash) + return false, nil + } + var valid *bool = nil terminatedMessage := ""