Skip to content

Commit

Permalink
action: simplify chart diff logic
Browse files Browse the repository at this point in the history
We actually only care about the chart name or version changing, as we
assume proper (immutable) versioning by the publisher of the chart
(either the user, or the source-controller).

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco committed Nov 3, 2023
1 parent 63e428a commit 628b6cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
8 changes: 3 additions & 5 deletions internal/action/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
ErrReleaseNotObserved = errors.New("release not observed to be made for object")
ErrReleaseDigest = errors.New("release digest verification error")
ErrChartChanged = errors.New("release chart changed")
ErrConfigDigest = errors.New("release config digest verification error")
ErrConfigDigest = errors.New("release config values changed")
)

// ReleaseTargetChanged returns true if the given release and/or chart
Expand Down Expand Up @@ -157,10 +157,8 @@ func VerifyRelease(rls *helmrelease.Release, snapshot *v2.Snapshot, chrt *helmch
return ErrReleaseNotFound
}

if chrt != nil {
if _, eq := chartutil.DiffMeta(*rls.Chart.Metadata, *chrt); !eq {
return ErrChartChanged
}
if chrt != nil && (rls.Chart.Metadata.Name != chrt.Name || rls.Chart.Metadata.Version != chrt.Version) {
return ErrChartChanged
}

if snapshot == nil || !chartutil.VerifyValues(digest.Digest(snapshot.ConfigDigest), vals) {
Expand Down
30 changes: 0 additions & 30 deletions internal/chartutil/diff.go

This file was deleted.

0 comments on commit 628b6cb

Please sign in to comment.