Skip to content

Commit 7a77c16

Browse files
committed
Fix nil pointer deref during diff attempt
Signed-off-by: Hidde Beydals <[email protected]>
1 parent 8448b1d commit 7a77c16

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/controllers/helmrelease_controller.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"strings"
2424
"time"
2525

26-
"github.com/hashicorp/go-retryablehttp"
2726
"helm.sh/helm/v3/pkg/chart"
2827
"helm.sh/helm/v3/pkg/chartutil"
2928
"helm.sh/helm/v3/pkg/storage/driver"
@@ -329,7 +328,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context,
329328
hr, hasNewState := v2.HelmReleaseAttempted(hr, revision, releaseRevision, valuesChecksum)
330329

331330
// Run diff against current cluster state.
332-
if !hasNewState {
331+
if !hasNewState && rel != nil {
333332
if ok, _ := features.Enabled(features.DetectDrift); ok {
334333
differ := diff.NewDiffer(runtimeClient.NewImpersonator(
335334
r.Client,

0 commit comments

Comments
 (0)