Skip to content

Commit

Permalink
Use semantic DeepEqual in foghorn controller
Browse files Browse the repository at this point in the history
  • Loading branch information
dippynark committed Jan 8, 2024
1 parent 867b0b5 commit 0855911
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/foghorn/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package foghorn
import (
"context"
"fmt"
"reflect"
"strings"
"sync"
"time"
Expand All @@ -18,6 +17,7 @@ import (
"github.com/jenkins-x/lighthouse/pkg/watcher"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -121,7 +121,7 @@ func (r *LighthouseJobReconciler) Reconcile(ctx context.Context, req ctrl.Reques
r.updateJobStatusForActivity(activityRecord, jobCopy)
r.reportStatus(activityRecord, jobCopy)

if !reflect.DeepEqual(job.Status, jobCopy.Status) {
if !equality.Semantic.DeepEqual(job.Status, jobCopy.Status) {
f := func(job *lighthousev1alpha1.LighthouseJob) error {
job.Status = jobCopy.Status
if err := r.client.Status().Update(ctx, job); err != nil {
Expand Down

0 comments on commit 0855911

Please sign in to comment.