You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dh...@apache.org on 2020/10/30 18:05:52 UTC

[camel-k] branch release-1.2.x updated: Fix ENTESB-15219: only use default values when user doesn't provide a kamelet property value in integration

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

dhirajsb pushed a commit to branch release-1.2.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/release-1.2.x by this push:
     new fe448c9  Fix ENTESB-15219: only use default values when user doesn't provide a kamelet property value in integration
     new c5d3b64  Merge pull request #1797 from dhirajsb/ENTESB-15219-1.2.x
fe448c9 is described below

commit fe448c93403b87910e4ee271067d879b7f11b0b2
Author: Dhiraj Bokde <db...@redhat.com>
AuthorDate: Thu Oct 29 19:22:32 2020 -0700

    Fix ENTESB-15219: only use default values when user doesn't provide a kamelet property value in integration
---
 pkg/trait/kamelets.go | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/pkg/trait/kamelets.go b/pkg/trait/kamelets.go
index 95f875f..c5de266 100644
--- a/pkg/trait/kamelets.go
+++ b/pkg/trait/kamelets.go
@@ -169,7 +169,19 @@ func (t *kameletsTrait) configureApplicationProperties(e *Environment) error {
 		// Configuring defaults from Kamelet
 		for _, prop := range kamelet.Status.Properties {
 			if prop.Default != "" {
-				e.ApplicationProperties[fmt.Sprintf("camel.kamelet.%s.%s", kamelet.Name, prop.Name)] = prop.Default
+				// Check whether user specified a value
+				userDefined := false
+				propName := fmt.Sprintf("camel.kamelet.%s.%s", kamelet.Name, prop.Name)
+				propPrefix := propName + "="
+				for _, userProp := range e.Integration.Spec.Configuration {
+					if strings.HasPrefix(userProp.Value, propPrefix) {
+						userDefined = true
+						break
+					}
+				}
+				if !userDefined {
+					e.ApplicationProperties[propName] = prop.Default
+				}
 			}
 		}
 	}