This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch release-1.4.x in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/release-1.4.x by this push: new f3549df fix(build): Default to routine build strategy for local IntegrationPlatform f3549df is described below commit f3549df1c89006e3b5425e92bbb4b4fa61f6e00d Author: Antonin Stefanutti <anto...@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 } }