Skip to content

Commit 72867ea

Browse files
committed
Support RFC-0005 revision format
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>
1 parent 16fd8f9 commit 72867ea

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

controllers/helmrelease_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ func (r *HelmReleaseReconciler) requestsForHelmChartChange(o client.Object) []re
714714
for _, i := range list.Items {
715715
// If the revision of the artifact equals to the last attempted revision,
716716
// we should not make a request for this HelmRelease
717-
if hc.GetArtifact().Revision == i.Status.LastAttemptedRevision {
717+
if hc.GetArtifact().HasRevision(i.Status.LastAttemptedRevision) {
718718
continue
719719
}
720720
reqs = append(reqs, reconcile.Request{NamespacedName: client.ObjectKeyFromObject(&i)})

controllers/source_predicate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (SourceRevisionChangePredicate) Update(e event.UpdateEvent) bool {
4747
}
4848

4949
if oldSource.GetArtifact() != nil && newSource.GetArtifact() != nil &&
50-
oldSource.GetArtifact().Revision != newSource.GetArtifact().Revision {
50+
!oldSource.GetArtifact().HasRevision(newSource.GetArtifact().Revision) {
5151
return true
5252
}
5353

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/fluxcd/pkg/apis/kustomize v0.8.0
1212
github.com/fluxcd/pkg/apis/meta v0.19.0
1313
github.com/fluxcd/pkg/runtime v0.27.0
14-
github.com/fluxcd/source-controller/api v0.34.0
14+
github.com/fluxcd/source-controller/api v0.34.1-0.20230210193059-0d50ac3eef23
1515
github.com/go-logr/logr v1.2.3
1616
github.com/hashicorp/go-retryablehttp v0.7.2
1717
github.com/onsi/gomega v1.26.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ github.com/fluxcd/pkg/apis/meta v0.19.0 h1:CX75e/eaRWZDTzNdMSWomY1InlssLKcS8GQDS
168168
github.com/fluxcd/pkg/apis/meta v0.19.0/go.mod h1:7b6prDPsViyAzoY7eRfSPS0/MbXpGGsOMvRq2QrTKa4=
169169
github.com/fluxcd/pkg/runtime v0.27.0 h1:zVA95Z0KvNjvZxEZhvIbJyJIwtaiv1aVttHZ4YB/FzY=
170170
github.com/fluxcd/pkg/runtime v0.27.0/go.mod h1:fC1l4Wv1hnsqPKB46eDZBXF8RMZm5FXeU4bnJkwGkqk=
171-
github.com/fluxcd/source-controller/api v0.34.0 h1:M2kD95IdpmHcDNy78K6T6p7niC38LGwSrKq8XAZEJY0=
172-
github.com/fluxcd/source-controller/api v0.34.0/go.mod h1:w3PDdR+FZyq3zyyUDxz6vY3CKByZfYAjkzJUxuUXCuc=
171+
github.com/fluxcd/source-controller/api v0.34.1-0.20230210193059-0d50ac3eef23 h1:KyzCcKiJHOCAPy8MYcwfgnChtJkr1Iga5s024aAi6wg=
172+
github.com/fluxcd/source-controller/api v0.34.1-0.20230210193059-0d50ac3eef23/go.mod h1:w3PDdR+FZyq3zyyUDxz6vY3CKByZfYAjkzJUxuUXCuc=
173173
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
174174
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
175175
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=

0 commit comments

Comments
 (0)