@@ -223,7 +223,7 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques
223223 // Resolve the source reference and requeue the reconciliation if the source is not found.
224224 artifactSource , err := r .getSource (ctx , obj )
225225 if err != nil {
226- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ArtifactFailedReason , err .Error ())
226+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ArtifactFailedReason , err .Error ())
227227
228228 if apierrors .IsNotFound (err ) {
229229 msg := fmt .Sprintf ("Source '%s' not found" , obj .Spec .SourceRef .String ())
@@ -245,15 +245,15 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques
245245 // Requeue the reconciliation if the source artifact is not found.
246246 if artifactSource .GetArtifact () == nil {
247247 msg := fmt .Sprintf ("Source artifact not found, retrying in %s" , r .requeueDependency .String ())
248- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ArtifactFailedReason , msg )
248+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ArtifactFailedReason , msg )
249249 log .Info (msg )
250250 return ctrl.Result {RequeueAfter : r .requeueDependency }, nil
251251 }
252252
253253 // Check dependencies and requeue the reconciliation if the check fails.
254254 if len (obj .Spec .DependsOn ) > 0 {
255255 if err := r .checkDependencies (ctx , obj , artifactSource ); err != nil {
256- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .DependencyNotReadyReason , err .Error ())
256+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .DependencyNotReadyReason , err .Error ())
257257 msg := fmt .Sprintf ("Dependencies do not meet ready condition, retrying in %s" , r .requeueDependency .String ())
258258 log .Info (msg )
259259 r .event (obj , artifactSource .GetArtifact ().Revision , eventv1 .EventSeverityInfo , msg , nil )
@@ -268,7 +268,7 @@ func (r *KustomizationReconciler) Reconcile(ctx context.Context, req ctrl.Reques
268268 // Requeue at the specified retry interval if the artifact tarball is not found.
269269 if errors .Is (reconcileErr , fetch .ErrFileNotFound ) {
270270 msg := fmt .Sprintf ("Source is not ready, artifact not found, retrying in %s" , r .requeueDependency .String ())
271- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ArtifactFailedReason , msg )
271+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ArtifactFailedReason , msg )
272272 log .Info (msg )
273273 return ctrl.Result {RequeueAfter : r .requeueDependency }, nil
274274 }
@@ -333,20 +333,20 @@ func (r *KustomizationReconciler) reconcile(
333333 os .Getenv ("SOURCE_CONTROLLER_LOCALHOST" ),
334334 ctrl .LoggerFrom (ctx ),
335335 ).Fetch (src .GetArtifact ().URL , src .GetArtifact ().Digest , tmpDir ); err != nil {
336- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ArtifactFailedReason , err .Error ())
336+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ArtifactFailedReason , err .Error ())
337337 return err
338338 }
339339
340340 // check build path exists
341341 dirPath , err := securejoin .SecureJoin (tmpDir , obj .Spec .Path )
342342 if err != nil {
343- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ArtifactFailedReason , err .Error ())
343+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ArtifactFailedReason , err .Error ())
344344 return err
345345 }
346346
347347 if _ , err := os .Stat (dirPath ); err != nil {
348348 err = fmt .Errorf ("kustomization path not found: %w" , err )
349- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ArtifactFailedReason , err .Error ())
349+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ArtifactFailedReason , err .Error ())
350350 return err
351351 }
352352
@@ -373,33 +373,33 @@ func (r *KustomizationReconciler) reconcile(
373373 // Create the Kubernetes client that runs under impersonation.
374374 kubeClient , statusPoller , err := impersonation .GetClient (ctx )
375375 if err != nil {
376- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ReconciliationFailedReason , err .Error ())
376+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ReconciliationFailedReason , err .Error ())
377377 return fmt .Errorf ("failed to build kube client: %w" , err )
378378 }
379379
380380 // Generate kustomization.yaml if needed.
381381 k , err := runtime .DefaultUnstructuredConverter .ToUnstructured (obj )
382382 if err != nil {
383- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .BuildFailedReason , err .Error ())
383+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .BuildFailedReason , err .Error ())
384384 return err
385385 }
386386 err = r .generate (unstructured.Unstructured {Object : k }, tmpDir , dirPath )
387387 if err != nil {
388- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .BuildFailedReason , err .Error ())
388+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .BuildFailedReason , err .Error ())
389389 return err
390390 }
391391
392392 // Build the Kustomize overlay and decrypt secrets if needed.
393393 resources , err := r .build (ctx , obj , unstructured.Unstructured {Object : k }, tmpDir , dirPath )
394394 if err != nil {
395- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .BuildFailedReason , err .Error ())
395+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .BuildFailedReason , err .Error ())
396396 return err
397397 }
398398
399399 // Convert the build result into Kubernetes unstructured objects.
400400 objects , err := ssautil .ReadObjects (bytes .NewReader (resources ))
401401 if err != nil {
402- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .BuildFailedReason , err .Error ())
402+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .BuildFailedReason , err .Error ())
403403 return err
404404 }
405405
@@ -421,15 +421,15 @@ func (r *KustomizationReconciler) reconcile(
421421 // Validate and apply resources in stages.
422422 drifted , changeSet , err := r .apply (ctx , resourceManager , obj , revision , objects )
423423 if err != nil {
424- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ReconciliationFailedReason , err .Error ())
424+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ReconciliationFailedReason , err .Error ())
425425 return err
426426 }
427427
428428 // Create an inventory from the reconciled resources.
429429 newInventory := inventory .New ()
430430 err = inventory .AddChangeSet (newInventory , changeSet )
431431 if err != nil {
432- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ReconciliationFailedReason , err .Error ())
432+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ReconciliationFailedReason , err .Error ())
433433 return err
434434 }
435435
@@ -439,13 +439,13 @@ func (r *KustomizationReconciler) reconcile(
439439 // Detect stale resources which are subject to garbage collection.
440440 staleObjects , err := inventory .Diff (oldInventory , newInventory )
441441 if err != nil {
442- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .ReconciliationFailedReason , err .Error ())
442+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .ReconciliationFailedReason , err .Error ())
443443 return err
444444 }
445445
446446 // Run garbage collection for stale resources that do not have pruning disabled.
447447 if _ , err := r .prune (ctx , resourceManager , obj , revision , staleObjects ); err != nil {
448- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .PruneFailedReason , err .Error ())
448+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .PruneFailedReason , err .Error ())
449449 return err
450450 }
451451
@@ -459,7 +459,7 @@ func (r *KustomizationReconciler) reconcile(
459459 isNewRevision ,
460460 drifted ,
461461 changeSet .ToObjMetadataSet ()); err != nil {
462- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .HealthCheckFailedReason , err .Error ())
462+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .HealthCheckFailedReason , err .Error ())
463463 return err
464464 }
465465
@@ -469,7 +469,7 @@ func (r *KustomizationReconciler) reconcile(
469469 // Mark the object as ready.
470470 conditions .MarkTrue (obj ,
471471 meta .ReadyCondition ,
472- kustomizev1 .ReconciliationSucceededReason ,
472+ meta .ReconciliationSucceededReason ,
473473 fmt .Sprintf ("Applied revision: %s" , revision ))
474474
475475 return nil
@@ -856,7 +856,7 @@ func (r *KustomizationReconciler) checkHealth(ctx context.Context,
856856 drifted bool ,
857857 objects object.ObjMetadataSet ) error {
858858 if len (obj .Spec .HealthChecks ) == 0 && ! obj .Spec .Wait {
859- conditions .Delete (obj , kustomizev1 .HealthyCondition )
859+ conditions .Delete (obj , meta .HealthyCondition )
860860 return nil
861861 }
862862
@@ -870,7 +870,7 @@ func (r *KustomizationReconciler) checkHealth(ctx context.Context,
870870 }
871871
872872 if len (objects ) == 0 {
873- conditions .Delete (obj , kustomizev1 .HealthyCondition )
873+ conditions .Delete (obj , meta .HealthyCondition )
874874 return nil
875875 }
876876
@@ -886,12 +886,12 @@ func (r *KustomizationReconciler) checkHealth(ctx context.Context,
886886 }
887887
888888 // Find the previous health check result.
889- wasHealthy := apimeta .IsStatusConditionTrue (obj .Status .Conditions , kustomizev1 .HealthyCondition )
889+ wasHealthy := apimeta .IsStatusConditionTrue (obj .Status .Conditions , meta .HealthyCondition )
890890
891891 // Update status with the reconciliation progress.
892892 message := fmt .Sprintf ("Running health checks for revision %s with a timeout of %s" , revision , obj .GetTimeout ().String ())
893893 conditions .MarkReconciling (obj , meta .ProgressingReason , message )
894- conditions .MarkUnknown (obj , kustomizev1 .HealthyCondition , meta .ProgressingReason , message )
894+ conditions .MarkUnknown (obj , meta .HealthyCondition , meta .ProgressingReason , message )
895895 if err := r .patch (ctx , obj , patcher ); err != nil {
896896 return fmt .Errorf ("unable to update the healthy status to progressing: %w" , err )
897897 }
@@ -902,8 +902,8 @@ func (r *KustomizationReconciler) checkHealth(ctx context.Context,
902902 Timeout : obj .GetTimeout (),
903903 FailFast : r .FailFast ,
904904 }); err != nil {
905- conditions .MarkFalse (obj , meta .ReadyCondition , kustomizev1 .HealthCheckFailedReason , err .Error ())
906- conditions .MarkFalse (obj , kustomizev1 .HealthyCondition , kustomizev1 .HealthCheckFailedReason , err .Error ())
905+ conditions .MarkFalse (obj , meta .ReadyCondition , meta .HealthCheckFailedReason , err .Error ())
906+ conditions .MarkFalse (obj , meta .HealthyCondition , meta .HealthCheckFailedReason , err .Error ())
907907 return fmt .Errorf ("health check failed after %s: %w" , time .Since (checkStart ).String (), err )
908908 }
909909
@@ -913,7 +913,7 @@ func (r *KustomizationReconciler) checkHealth(ctx context.Context,
913913 r .event (obj , revision , eventv1 .EventSeverityInfo , msg , nil )
914914 }
915915
916- conditions .MarkTrue (obj , kustomizev1 .HealthyCondition , meta .SucceededReason , msg )
916+ conditions .MarkTrue (obj , meta .HealthyCondition , meta .SucceededReason , msg )
917917 if err := r .patch (ctx , obj , patcher ); err != nil {
918918 return fmt .Errorf ("unable to update the healthy status to progressing: %w" , err )
919919 }
@@ -1077,7 +1077,7 @@ func (r *KustomizationReconciler) patch(ctx context.Context,
10771077 // Configure the runtime patcher.
10781078 patchOpts := []patch.Option {}
10791079 ownedConditions := []string {
1080- kustomizev1 .HealthyCondition ,
1080+ meta .HealthyCondition ,
10811081 meta .ReadyCondition ,
10821082 meta .ReconcilingCondition ,
10831083 meta .StalledCondition ,
0 commit comments