You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/06/30 08:19:13 UTC

[GitHub] [camel-k] christophd commented on a diff in pull request #3402: fix(#3393): Update to CronJob batch/v1

christophd commented on code in PR #3402:
URL: https://github.com/apache/camel-k/pull/3402#discussion_r910742677


##########
pkg/cmd/operator/operator.go:
##########
@@ -193,6 +193,23 @@ func Run(healthPort, monitoringPort int32, leaderElection bool, leaderElectionID
 	exitOnError(err, "cannot create Integration label selector")
 	selector := labels.NewSelector().Add(*hasIntegrationLabel)
 
+	selectors := cache.SelectorsByObject{
+		&corev1.Pod{}:        {Label: selector},
+		&appsv1.Deployment{}: {Label: selector},
+		&batchv1.Job{}:       {Label: selector},
+		&servingv1.Service{}: {Label: selector},
+	}
+
+	if ok, err := kubernetes.IsAPIResourceInstalled(c, batchv1.SchemeGroupVersion.String(), reflect.TypeOf(batchv1.CronJob{}).Name()); ok && err == nil {
+		selectors = cache.SelectorsByObject{
+			&corev1.Pod{}:        {Label: selector},
+			&appsv1.Deployment{}: {Label: selector},
+			&batchv1.CronJob{}:   {Label: selector},
+			&batchv1.Job{}:       {Label: selector},
+			&servingv1.Service{}: {Label: selector},
+		}

Review Comment:
   yes much better! Nice trick! Was struggling to initialize the cache internal Selector before



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org