Skip to content

Commit

Permalink
Use Revision to detect object changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Aug 29, 2024
1 parent e4efbbc commit 8e5f5b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controllers/validation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@ func (r *RpaasValidationReconciler) Reconcile(ctx context.Context, req ctrl.Requ
return reconcile.Result{}, err
}

validationHash, err := generateSpecHash(&validation.Spec)
if err != nil {
return reconcile.Result{}, err
}

if validation.Status.RevisionHash == validationHash && validation.Status.Valid != nil {
if validation.Status.ObservedGeneration == validation.ObjectMeta.Generation && validation.Status.Valid != nil {
return reconcile.Result{}, nil
}

Expand Down Expand Up @@ -92,6 +87,11 @@ func (r *RpaasValidationReconciler) Reconcile(ctx context.Context, req ctrl.Requ
return reconcile.Result{}, err
}

validationHash, err := generateSpecHash(&validation.Spec)
if err != nil {
return reconcile.Result{}, err
}

pod := newValidationPod(validationMergedWithFlavors, validationHash, plan, configMap)

existingPod, err := r.getPod(ctx, pod.Namespace, pod.Name)
Expand Down

0 comments on commit 8e5f5b8

Please sign in to comment.