Skip to content

Commit

Permalink
fix constant reconcilation issue in helm controller
Browse files Browse the repository at this point in the history
Signed-off-by: Adam D. Cornett <[email protected]>
  • Loading branch information
acornett21 committed Jan 13, 2025
1 parent d5cc16b commit fd53c06
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/helm/controller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"errors"
"fmt"
"reflect"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -104,6 +105,7 @@ func (r HelmOperatorReconciler) Reconcile(ctx context.Context, request reconcile
}

status := types.StatusFor(o)
originalStatus := o.DeepCopy().Object["status"]
log = log.WithValues("release", manager.ReleaseName())

reconcileResult := reconcile.Result{RequeueAfter: r.ReconcilePeriod}
Expand Down Expand Up @@ -421,7 +423,10 @@ func (r HelmOperatorReconciler) Reconcile(ctx context.Context, request reconcile
Manifest: expectedRelease.Manifest,
}

err = r.updateResourceStatus(ctx, o, status)
if !reflect.DeepEqual(status, originalStatus) {
err = r.updateResourceStatus(ctx, o, status)
}

return reconcileResult, err
}

Expand Down

0 comments on commit fd53c06

Please sign in to comment.