You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2019/04/19 19:29:15 UTC

[GitHub] [camel-k] davsclaus commented on a change in pull request #631: Use non-caching client in builds scheduling critical section

davsclaus commented on a change in pull request #631: Use non-caching client in builds scheduling critical section
URL: https://github.com/apache/camel-k/pull/631#discussion_r277072133
 
 

 ##########
 File path: pkg/controller/build/build_controller.go
 ##########
 @@ -30,16 +31,33 @@ func Add(mgr manager.Manager) error {
 	if err != nil {
 		return err
 	}
-	return add(mgr, newReconciler(mgr, c))
+	reconciler, err := newReconciler(mgr, c)
+	if err != nil {
+		return err
+	}
+	return add(mgr, reconciler)
 }
 
 // newReconciler returns a new reconcile.Reconciler
-func newReconciler(mgr manager.Manager, c client.Client) reconcile.Reconciler {
+func newReconciler(mgr manager.Manager, c client.Client) (reconcile.Reconciler, error) {
+	// Non-caching client to be used whenever caching may cause race conditions,
+	// like in the builds scheduling critical section.
+	// To be replaced with Manager.GetAPIReader() as soon as it's available, see:
+	// https://github.com/kubernetes-sigs/controller-runtime/pull/327
 
 Review comment:
   Maybe we can add `TODO` so we will find this in the future and remember to fix/do this when that k8s is released and we are basing on such k8s version

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services