You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/06/05 13:33:36 UTC
[camel-k] branch release-1.12.x updated: fix: Avoid build monitor to block builds with maxRunningBuilds=0
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch release-1.12.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/release-1.12.x by this push:
new 6797daed7 fix: Avoid build monitor to block builds with maxRunningBuilds=0
6797daed7 is described below
commit 6797daed7f3f9a2b0ff2b9ef62bd2acd545bebb2
Author: Christoph Deppisch <cd...@redhat.com>
AuthorDate: Thu Jun 1 15:08:13 2023 +0200
fix: Avoid build monitor to block builds with maxRunningBuilds=0
- MaxRunningBuilds=0 does not make sense
- Existing/pending builds may have MaxRunningBuilds=0 in its spec as it is a new setting in the BuildSpec
- Make sure to always use at least MaxRunningBuilds=1 which results in strictly sequential builds, only one single build running at a time
---
pkg/controller/build/build_controller.go | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pkg/controller/build/build_controller.go b/pkg/controller/build/build_controller.go
index 91a8174ec..3144e2f30 100644
--- a/pkg/controller/build/build_controller.go
+++ b/pkg/controller/build/build_controller.go
@@ -142,8 +142,14 @@ func (r *reconcileBuild) Reconcile(ctx context.Context, request reconcile.Reques
var actions []Action
+ // build monitor with strictly sequential builds, only one single build running at a time
buildMonitor := Monitor{
- maxRunningBuilds: instance.Spec.MaxRunningBuilds,
+ maxRunningBuilds: 1,
+ }
+
+ if instance.Spec.MaxRunningBuilds > 0 {
+ // set max running builds according to build spec to allow parallel builds for this operator
+ buildMonitor.maxRunningBuilds = instance.Spec.MaxRunningBuilds
}
switch instance.Spec.Strategy {