You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/09/09 09:53:14 UTC

[camel-k] 35/37: feat(native): Increase native build timeout to sensible default

This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 2e4eaacab1849f76628e41ad751e917473af559f
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Sep 8 12:04:54 2021 +0200

    feat(native): Increase native build timeout to sensible default
---
 pkg/controller/integrationkit/build.go | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/pkg/controller/integrationkit/build.go b/pkg/controller/integrationkit/build.go
index 9a8c390..4e8a688 100644
--- a/pkg/controller/integrationkit/build.go
+++ b/pkg/controller/integrationkit/build.go
@@ -21,6 +21,7 @@ import (
 	"context"
 	"fmt"
 	"strings"
+	"time"
 
 	"github.com/pkg/errors"
 
@@ -84,6 +85,13 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1.Int
 
 		labels := kubernetes.FilterCamelCreatorLabels(kit.Labels)
 		labels[v1.IntegrationKitLayoutLabel] = kit.Labels[v1.IntegrationKitLayoutLabel]
+		timeout := env.Platform.Status.Build.GetTimeout()
+		if layout := labels[v1.IntegrationKitLayoutLabel]; env.Platform.Spec.Build.Timeout == nil && layout == v1.IntegrationKitLayoutNative {
+			// Increase the timeout to a sensible default
+			timeout = metav1.Duration{
+				Duration: 10 * time.Minute,
+			}
+		}
 		build = &v1.Build{
 			TypeMeta: metav1.TypeMeta{
 				APIVersion: v1.SchemeGroupVersion.String(),
@@ -96,7 +104,7 @@ func (action *buildAction) handleBuildSubmitted(ctx context.Context, kit *v1.Int
 			},
 			Spec: v1.BuildSpec{
 				Tasks:   env.BuildTasks,
-				Timeout: env.Platform.Status.Build.GetTimeout(),
+				Timeout: timeout,
 			},
 		}