Skip to content

Commit

Permalink
Add log when validationHash changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Sep 30, 2024
1 parent 9cebef2 commit 1ab4c85
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions controllers/validation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 := ""

Expand Down

0 comments on commit 1ab4c85

Please sign in to comment.