Skip to content

Commit

Permalink
refactor: correctly compare string maps for drift state
Browse files Browse the repository at this point in the history
Signed-off-by: Raffael Sahli <[email protected]>
  • Loading branch information
raffis committed Mar 16, 2023
1 parent ce24c09 commit 9028e25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/helmrelease_controller_chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/hashicorp/go-retryablehttp"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/chart/loader"
apiequality "k8s.io/apimachinery/pkg/api/equality"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -245,9 +246,9 @@ func helmChartRequiresUpdate(hr *v2.HelmRelease, chart *sourcev1.HelmChart) bool
return true
case template.Spec.ValuesFile != chart.Spec.ValuesFile:
return true
case !reflect.DeepEqual(template.Annotations, chart.Annotations):
case !apiequality.Semantic.DeepEqual(template.Annotations, chart.Annotations):
return true
case !reflect.DeepEqual(template.Labels, chart.Labels):
case !apiequality.Semantic.DeepEqual(template.Labels, chart.Labels):
return true
case !reflect.DeepEqual(templateVerificationToSourceVerification(template.Spec.Verify), chart.Spec.Verify):
return true
Expand Down

0 comments on commit 9028e25

Please sign in to comment.