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 2024/04/25 15:08:40 UTC

(camel-k) 01/02: fix(trait): compute cm after catalog

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

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

commit ccfd73036ad478db99d6cf963a65e9522b19d225
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Thu Apr 25 12:46:42 2024 +0200

    fix(trait): compute cm after catalog
    
    Closes #5420
---
 pkg/trait/camel.go | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/pkg/trait/camel.go b/pkg/trait/camel.go
index 46a7ef2d3..8902d24ad 100644
--- a/pkg/trait/camel.go
+++ b/pkg/trait/camel.go
@@ -79,11 +79,6 @@ func (t *camelTrait) Configure(e *Environment) (bool, *TraitCondition, error) {
 }
 
 func (t *camelTrait) Apply(e *Environment) error {
-	if e.IntegrationKitInPhase(v1.IntegrationKitPhaseReady) && e.IntegrationInRunningPhases() {
-		// Get all resources
-		maps := t.computeConfigMaps(e)
-		e.Resources.AddAll(maps)
-	}
 	if e.IntegrationKit != nil && e.IntegrationKit.IsSynthetic() {
 		// This is required as during init phase, the trait set by default these values
 		// which are widely used in the platform for different purposese.
@@ -107,7 +102,11 @@ func (t *camelTrait) Apply(e *Environment) error {
 		e.IntegrationKit.Status.RuntimeVersion = e.CamelCatalog.Runtime.Version
 		e.IntegrationKit.Status.RuntimeProvider = e.CamelCatalog.Runtime.Provider
 	}
-
+	if e.IntegrationKitInPhase(v1.IntegrationKitPhaseReady) && e.IntegrationInRunningPhases() {
+		// Get all resources
+		maps := t.computeConfigMaps(e)
+		e.Resources.AddAll(maps)
+	}
 	return nil
 }