You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "squakez (via GitHub)" <gi...@apache.org> on 2023/04/10 08:33:50 UTC

[GitHub] [camel-k] squakez commented on a diff in pull request #4233: fix: Limit parallel builds on operator

squakez commented on code in PR #4233:
URL: https://github.com/apache/camel-k/pull/4233#discussion_r1161540637


##########
pkg/apis/camel/v1/build_types.go:
##########
@@ -41,6 +41,8 @@ type BuildSpec struct {
 	// and its phase set to BuildPhaseFailed.
 	// +kubebuilder:validation:Format=duration
 	Timeout metav1.Duration `json:"timeout,omitempty"`
+	// the maximum amount of parallel running builds started by this operator instance
+	MaxRunningBuilds int32 `json:"maxRunningBuilds,omitempty"`

Review Comment:
   I think the Build should not be aware of this information. It seems something to the domain of the controller instead, not of this resource specifically.



##########
pkg/platform/defaults.go:
##########
@@ -226,6 +226,15 @@ func setPlatformDefaults(p *v1.IntegrationPlatform, verbose bool) error {
 			Duration: 5 * time.Minute,
 		}
 	}
+
+	if p.Status.Build.MaxRunningBuilds <= 0 {
+		if p.Status.Build.BuildStrategy == v1.BuildStrategyRoutine {
+			p.Status.Build.MaxRunningBuilds = 3

Review Comment:
   I think we should provide these defaults in the pkg/util/defautls/defaults.go resource so it's easier to inspect as it happens for other operator constants.



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