Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: kustomize-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.1/source-controller.crds.yaml
- https://github.com/fluxcd/source-controller/releases/download/v0.35.1/source-controller.deployment.yaml
- ../crd
- ../rbac
- ../manager
Expand Down
7 changes: 3 additions & 4 deletions controllers/kustomization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,8 @@ func (r *KustomizationReconciler) reconcile(
src sourcev1.Source,
patcher *patch.SerialPatcher) error {

revision := src.GetArtifact().Revision
isNewRevision := obj.Status.LastAppliedRevision != revision

// Update status with the reconciliation progress.
revision := src.GetArtifact().Revision
progressingMsg := fmt.Sprintf("Fetching manifests for revision %s with a timeout of %s", revision, obj.GetTimeout().String())
conditions.MarkUnknown(obj, meta.ReadyCondition, meta.ProgressingReason, "Reconciliation in progress")
conditions.MarkReconciling(obj, meta.ProgressingReason, progressingMsg)
Expand Down Expand Up @@ -439,6 +437,7 @@ func (r *KustomizationReconciler) reconcile(
}

// Run the health checks for the last applied resources.
isNewRevision := !src.GetArtifact().HasRevision(obj.Status.LastAppliedRevision)
if err := r.checkHealth(ctx,
resourceManager,
patcher,
Expand Down Expand Up @@ -491,7 +490,7 @@ func (r *KustomizationReconciler) checkDependencies(ctx context.Context,
if k.Spec.SourceRef.Name == obj.Spec.SourceRef.Name &&
k.Spec.SourceRef.Namespace == obj.Spec.SourceRef.Namespace &&
k.Spec.SourceRef.Kind == obj.Spec.SourceRef.Kind &&
source.GetArtifact().Revision != k.Status.LastAppliedRevision {
!source.GetArtifact().HasRevision(k.Status.LastAppliedRevision) {
return fmt.Errorf("dependency '%s' revision is not up to date", dName)
}
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/kustomization_indexers.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *KustomizationReconciler) requestsForRevisionChangeOf(indexKey string) f
for _, d := range list.Items {
// If the revision of the artifact equals to the last attempted revision,
// we should not make a request for this Kustomization
if repo.GetArtifact().Revision == d.Status.LastAttemptedRevision {
if repo.GetArtifact().HasRevision(d.Status.LastAttemptedRevision) {
continue
}
dd = append(dd, d.DeepCopy())
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 @@ -30,7 +30,7 @@ require (
github.com/fluxcd/pkg/ssa v0.23.1
github.com/fluxcd/pkg/tar v0.2.0
github.com/fluxcd/pkg/testserver v0.4.0
github.com/fluxcd/source-controller/api v0.34.0
github.com/fluxcd/source-controller/api v0.35.1
github.com/hashicorp/vault/api v1.9.0
github.com/onsi/gomega v1.26.0
github.com/ory/dockertest/v3 v3.9.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ github.com/fluxcd/pkg/tar v0.2.0 h1:HEUHgONQYsJGeZZ4x6h5nQU9Aox1I4T3bOp1faWTqf8=
github.com/fluxcd/pkg/tar v0.2.0/go.mod h1:w0/TOC7kwBJhnSJn7TCABkc/I7ib1f2Yz6vOsbLBnhw=
github.com/fluxcd/pkg/testserver v0.4.0 h1:pDZ3gistqYhwlf3sAjn1Q8NzN4Qe6I1BEmHMHi46lMg=
github.com/fluxcd/pkg/testserver v0.4.0/go.mod h1:gjOKX41okmrGYOa4oOF2fiLedDAfPo1XaG/EzrUUGBI=
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.1 h1:IHlbN7giz5kY4z9oWZ9QLNKtHAaxHdk9RbIurUPS1aI=
github.com/fluxcd/source-controller/api v0.35.1/go.mod h1:TImPMy/MEwNpDu6qHsw9LlCznXaB8bSO8mnxBSFsX4Q=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
Expand Down