@@ -206,7 +206,7 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques
206
206
207
207
// check dependencies
208
208
if len (kustomization .Spec .DependsOn ) > 0 {
209
- if err := r .checkDependencies (kustomization ); err != nil {
209
+ if err := r .checkDependencies (source , kustomization ); err != nil {
210
210
kustomization = kustomizev1 .KustomizationNotReady (
211
211
kustomization , source .GetArtifact ().Revision , meta .DependencyNotReadyReason , err .Error ())
212
212
if err := r .patchStatus (ctx , req , kustomization .Status ); err != nil {
@@ -471,7 +471,7 @@ func (r *KustomizationReconciler) reconcile(
471
471
), nil
472
472
}
473
473
474
- func (r * KustomizationReconciler ) checkDependencies (kustomization kustomizev1.Kustomization ) error {
474
+ func (r * KustomizationReconciler ) checkDependencies (source sourcev1. Source , kustomization kustomizev1.Kustomization ) error {
475
475
for _ , d := range kustomization .Spec .DependsOn {
476
476
if d .Namespace == "" {
477
477
d .Namespace = kustomization .GetNamespace ()
@@ -490,6 +490,10 @@ func (r *KustomizationReconciler) checkDependencies(kustomization kustomizev1.Ku
490
490
if ! apimeta .IsStatusConditionTrue (k .Status .Conditions , meta .ReadyCondition ) {
491
491
return fmt .Errorf ("dependency '%s' is not ready" , dName )
492
492
}
493
+
494
+ if k .Spec .SourceRef .Name == kustomization .Spec .SourceRef .Name && k .Spec .SourceRef .Namespace == kustomization .Spec .SourceRef .Namespace && k .Spec .SourceRef .Kind == kustomization .Spec .SourceRef .Kind && source .GetArtifact ().Revision != k .Status .LastAppliedRevision {
495
+ return fmt .Errorf ("dependency '%s' is not updated yet" , dName )
496
+ }
493
497
}
494
498
495
499
return nil
0 commit comments