astefanutti commented on a change in pull request #1438: URL: https://github.com/apache/camel-k/pull/1438#discussion_r418081853
########## File path: pkg/controller/integration/integration_controller.go ########## @@ -200,6 +203,35 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { return err } + // Watch deployment to update the ready condition + err = c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &v1.Integration{}, + IsController: false, + }) + if err != nil { + return err + } + + // Watch Knative service to update the ready condition + err = c.Watch(&source.Kind{Type: &servingv1.Service{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &v1.Integration{}, + IsController: false, + }) + if _, ok := err.(*meta.NoKindMatchError); ok { + log.Info("No watch has been set on Knative services because the type is not known") + } else if err != nil { + log.Error(err, "Cannot set watch on Knative services") + } + + // Watch cronjob to update the ready condition + err = c.Watch(&source.Kind{Type: &v1beta1.CronJob{}}, &handler.EnqueueRequestForOwner{ + OwnerType: &v1.Integration{}, + IsController: false, + }) + if err != nil { + return err + } + Review comment: We already watch the `ReplicaSet` to reconcile the replica count, that works both for _deployment_ and Knative strategies. IIRC it also gives the number of ready replicas so I wonder whether it is necessary to add other watches. Also the number of replicas should be taken into account. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org