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