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/04/28 13:22:56 UTC

[camel-k] branch main updated: fix(build): Default to routine build strategy for local IntegrationPlatform

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


The following commit(s) were added to refs/heads/main by this push:
     new 649271c  fix(build): Default to routine build strategy for local IntegrationPlatform
649271c is described below

commit 649271cc69578c455faae4618963b77e50237dc0
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Apr 27 12:54:23 2021 +0200

    fix(build): Default to routine build strategy for local IntegrationPlatform
---
 pkg/platform/defaults.go | 29 ++++++-----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/pkg/platform/defaults.go b/pkg/platform/defaults.go
index 9e344f0..02264e2 100644
--- a/pkg/platform/defaults.go
+++ b/pkg/platform/defaults.go
@@ -76,30 +76,13 @@ func ConfigureDefaults(ctx context.Context, c client.Client, p *v1.IntegrationPl
 	}
 
 	if p.Status.Build.BuildStrategy == "" {
-		operatorIsLocal := !IsCurrentOperatorGlobal()
-		// Local operators build in the same namespace by definition
-		buildInDifferentNamespace := !operatorIsLocal
-		if !operatorIsLocal {
-			// Unless it's a global operator using a globally shared integration platform
-			buildInDifferentNamespace = p.Namespace != GetOperatorNamespace()
-		}
-
-		// If the operator and the build are in different namespaces, pod strategy should be used (except for Spectrum)
-		if buildInDifferentNamespace {
-			if p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategySpectrum {
-				p.Status.Build.BuildStrategy = v1.IntegrationPlatformBuildStrategyRoutine
-			} else {
-				p.Status.Build.BuildStrategy = v1.IntegrationPlatformBuildStrategyPod
-			}
+		// Use the fastest strategy that they support (routine when possible)
+		if p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyS2I ||
+			p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategySpectrum {
+			p.Status.Build.BuildStrategy = v1.IntegrationPlatformBuildStrategyRoutine
 		} else {
-			// Same-namespace builds use the fastest strategy that they support (routine when possible)
-			if p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategyS2I ||
-				p.Status.Build.PublishStrategy == v1.IntegrationPlatformBuildPublishStrategySpectrum {
-				p.Status.Build.BuildStrategy = v1.IntegrationPlatformBuildStrategyRoutine
-			} else {
-				// The build output has to be shared via a volume
-				p.Status.Build.BuildStrategy = v1.IntegrationPlatformBuildStrategyPod
-			}
+			// The build output has to be shared via a volume
+			p.Status.Build.BuildStrategy = v1.IntegrationPlatformBuildStrategyPod
 		}
 	}