Skip to content

Commit

Permalink
Support RFC-0005 revision format
Browse files Browse the repository at this point in the history
This updates all the comparisons to make use of `HasRevision` which
supports the RFC-0005 and legacy revision formats.

Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Feb 13, 2023
1 parent 16fd8f9 commit 72867ea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion controllers/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func (r *HelmReleaseReconciler) requestsForHelmChartChange(o client.Object) []re
for _, i := range list.Items {
// If the revision of the artifact equals to the last attempted revision,
// we should not make a request for this HelmRelease
if hc.GetArtifact().Revision == i.Status.LastAttemptedRevision {
if hc.GetArtifact().HasRevision(i.Status.LastAttemptedRevision) {
continue
}
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)})
Expand Down
2 changes: 1 addition & 1 deletion controllers/source_predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (SourceRevisionChangePredicate) Update(e event.UpdateEvent) bool {
}

if oldSource.GetArtifact() != nil && newSource.GetArtifact() != nil &&
oldSource.GetArtifact().Revision != newSource.GetArtifact().Revision {
!oldSource.GetArtifact().HasRevision(newSource.GetArtifact().Revision) {
return true
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/fluxcd/pkg/apis/kustomize v0.8.0
github.com/fluxcd/pkg/apis/meta v0.19.0
github.com/fluxcd/pkg/runtime v0.27.0
github.com/fluxcd/source-controller/api v0.34.0
github.com/fluxcd/source-controller/api v0.34.1-0.20230210193059-0d50ac3eef23
github.com/go-logr/logr v1.2.3
github.com/hashicorp/go-retryablehttp v0.7.2
github.com/onsi/gomega v1.26.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ github.com/fluxcd/pkg/apis/meta v0.19.0 h1:CX75e/eaRWZDTzNdMSWomY1InlssLKcS8GQDS
github.com/fluxcd/pkg/apis/meta v0.19.0/go.mod h1:7b6prDPsViyAzoY7eRfSPS0/MbXpGGsOMvRq2QrTKa4=
github.com/fluxcd/pkg/runtime v0.27.0 h1:zVA95Z0KvNjvZxEZhvIbJyJIwtaiv1aVttHZ4YB/FzY=
github.com/fluxcd/pkg/runtime v0.27.0/go.mod h1:fC1l4Wv1hnsqPKB46eDZBXF8RMZm5FXeU4bnJkwGkqk=
github.com/fluxcd/source-controller/api v0.34.0 h1:M2kD95IdpmHcDNy78K6T6p7niC38LGwSrKq8XAZEJY0=
github.com/fluxcd/source-controller/api v0.34.0/go.mod h1:w3PDdR+FZyq3zyyUDxz6vY3CKByZfYAjkzJUxuUXCuc=
github.com/fluxcd/source-controller/api v0.34.1-0.20230210193059-0d50ac3eef23 h1:KyzCcKiJHOCAPy8MYcwfgnChtJkr1Iga5s024aAi6wg=
github.com/fluxcd/source-controller/api v0.34.1-0.20230210193059-0d50ac3eef23/go.mod h1:w3PDdR+FZyq3zyyUDxz6vY3CKByZfYAjkzJUxuUXCuc=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
Expand Down

0 comments on commit 72867ea

Please sign in to comment.