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 16, 2023
1 parent 16fd8f9 commit 8b3edfd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: helm-system
resources:
- https://github.com/fluxcd/source-controller/releases/download/v0.34.0/source-controller.crds.yaml
- https://github.com/fluxcd/source-controller/releases/download/v0.34.0/source-controller.deployment.yaml
- https://github.com/fluxcd/source-controller/releases/download/v0.35.0/source-controller.crds.yaml
- https://github.com/fluxcd/source-controller/releases/download/v0.35.0/source-controller.deployment.yaml
- ../crd
- ../rbac
- ../manager
Expand Down
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
4 changes: 2 additions & 2 deletions 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.35.0
github.com/go-logr/logr v1.2.3
github.com/hashicorp/go-retryablehttp v0.7.2
github.com/onsi/gomega v1.26.0
Expand All @@ -23,7 +23,7 @@ require (
k8s.io/cli-runtime v0.26.1
k8s.io/client-go v0.26.1
k8s.io/utils v0.0.0-20230115233650-391b47cb4029
sigs.k8s.io/controller-runtime v0.14.2
sigs.k8s.io/controller-runtime v0.14.4
sigs.k8s.io/kustomize/api v0.12.1
sigs.k8s.io/yaml v1.3.0
)
Expand Down
8 changes: 4 additions & 4 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.35.0 h1:vVjUv4vxV3uS8AvdXe6J55TU88NwbpabPxlM72c7HwY=
github.com/fluxcd/source-controller/api v0.35.0/go.mod h1:TImPMy/MEwNpDu6qHsw9LlCznXaB8bSO8mnxBSFsX4Q=
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 Expand Up @@ -1060,8 +1060,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/cli-utils v0.34.0 h1:zCUitt54f0/MYj/ajVFnG6XSXMhpZ72O/3RewIchW8w=
sigs.k8s.io/cli-utils v0.34.0/go.mod h1:EXyMwPMu9OL+LRnj0JEMsGG/fRvbgFadcVlSnE8RhFs=
sigs.k8s.io/controller-runtime v0.14.2 h1:P6IwDhbsRWsBClt/8/h8Zy36bCuGuW5Op7MHpFrN/60=
sigs.k8s.io/controller-runtime v0.14.2/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M=
sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kustomize/api v0.12.1 h1:7YM7gW3kYBwtKvoY216ZzY+8hM+lV53LUayghNRJ0vM=
Expand Down

0 comments on commit 8b3edfd

Please sign in to comment.